diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2006-07-17 12:16:37 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2006-07-17 12:16:37 +0000 |
commit | 491f53a2e25d4cf8c23713c23431ef717708a1c2 (patch) | |
tree | c1ffe9202852bf8aa65e06fb00e38ceb096aa7a7 /sys/netinet/udp_usrreq.c | |
parent | 32526867e8eebc1ad5965c209271c3876e4c2767 (diff) |
Call ip_savecontrol() in the multicast codepath of udp_input() similar to
the INET6 code. With this it is possible to use e.g. IP_RECVIF to get the
incomming interface. SOCK_RAW is not affected by this.
Problem found and fixed by Michele 'mydecay' Marchetto. OK markus@
Diffstat (limited to 'sys/netinet/udp_usrreq.c')
-rw-r--r-- | sys/netinet/udp_usrreq.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 74566e38954..01c2d34f442 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udp_usrreq.c,v 1.109 2006/06/15 10:12:36 pascoe Exp $ */ +/* $OpenBSD: udp_usrreq.c,v 1.110 2006/07/17 12:16:36 claudio Exp $ */ /* $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */ /* @@ -463,6 +463,9 @@ udp_input(struct mbuf *m, ...) if (ip6 && (inp->inp_flags & IN6P_CONTROLOPTS)) ip6_savecontrol(inp, &opts, ip6, n); #endif /* INET6 */ + if (ip && (inp->inp_flags & INP_CONTROLOPTS)) + ip_savecontrol(inp, &opts, ip, n); + m_adj(n, iphlen); if (sbappendaddr(&last->so_rcv, &srcsa.sa, n, opts) == 0) { @@ -503,6 +506,9 @@ udp_input(struct mbuf *m, ...) if (ip6 && (inp->inp_flags & IN6P_CONTROLOPTS)) ip6_savecontrol(inp, &opts, ip6, m); #endif /* INET6 */ + if (ip && (inp->inp_flags & INP_CONTROLOPTS)) + ip_savecontrol(inp, &opts, ip, m); + m_adj(m, iphlen); if (sbappendaddr(&last->so_rcv, &srcsa.sa, m, opts) == 0) { |