summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_input.c
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2018-01-01 00:51:36 +0000
committerchristos <christos@NetBSD.org>2018-01-01 00:51:36 +0000
commit8a09fa14a0d307ae1a3639ba5ffaa467976992da (patch)
tree181cd544507c29ffa6c81a6311bbac8d0d885f62 /sys/netinet/ip_input.c
parent8362fcc1d3142d17cdbbae38e1c2bd16f37d4c48 (diff)
1) "#define ipi_spec_dst ipi_addr" in <netinet/in.h>
2) Change the IP_RECVPKTINFO option to control the generation of IP_PKTINFO control messages, the way it's done in Solaris. 3) Remove the superfluous IP_RECVPKTINFO control message. 4) Change the IP_PKTINFO option to do different things depending on the parameter it's supplied with: - If it's sizeof(int), assume it's being used as in Linux: - If it's non-zero, turn on the IP_RECVPKTINFO option. - If it's zero, turn off the IP_RECVPKTINFO option. - If it's sizeof(struct in_pktinfo), assume it's being used as in Solaris, to set a default for the source interface and/or source address for outgoing packets on the socket. 5) Return what Linux or Solaris compatible code expects, depending on data size, and just added a fallback to a Linux (and current NetBSD) compatible value if the size is unknown (as it is now), or, in the future, if the calling application specifies a receiving buffer that doesn't match either data item. From: Tom Ivar Helbekkmo
Diffstat (limited to 'sys/netinet/ip_input.c')
-rw-r--r--sys/netinet/ip_input.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index f434b299588..b2c982d6f25 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_input.c,v 1.363 2017/11/24 14:03:25 roy Exp $ */
+/* $NetBSD: ip_input.c,v 1.364 2018/01/01 00:51:36 christos Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.363 2017/11/24 14:03:25 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.364 2018/01/01 00:51:36 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -1533,15 +1533,6 @@ ip_savecontrol(struct inpcb *inp, struct mbuf **mp, struct ip *ip,
if (inpflags & INP_RECVPKTINFO) {
struct in_pktinfo ipi;
- ipi.ipi_addr = ip->ip_src;
- ipi.ipi_ifindex = ifp->if_index;
- *mp = sbcreatecontrol(&ipi,
- sizeof(ipi), IP_RECVPKTINFO, IPPROTO_IP);
- if (*mp)
- mp = &(*mp)->m_next;
- }
- if (inpflags & INP_PKTINFO) {
- struct in_pktinfo ipi;
ipi.ipi_addr = ip->ip_dst;
ipi.ipi_ifindex = ifp->if_index;
*mp = sbcreatecontrol(&ipi,