diff options
author | 2015-06-16 11:09:39 +0000 | |
---|---|---|
committer | 2015-06-16 11:09:39 +0000 | |
commit | fb492c3701798fad8024e2bd164905788c83671b (patch) | |
tree | c6607492c9afd90379dbfbaae78d4ee451192462 /sys/netinet/ip_output.c | |
parent | Be more strict about BER and DER terminology. (diff) | |
download | wireguard-openbsd-fb492c3701798fad8024e2bd164905788c83671b.tar.xz wireguard-openbsd-fb492c3701798fad8024e2bd164905788c83671b.zip |
Store a unique ID, an interface index, rather than a pointer to the
receiving interface in the packet header of every mbuf.
The interface pointer should now be retrieved when necessary with
if_get(). If a NULL pointer is returned by if_get(), the interface
has probably been destroy/removed and the mbuf should be freed.
Such mechanism will simplify garbage collection of mbufs and limit
problems with dangling ifp pointers.
Tested by jmatthew@ and krw@, discussed with many.
ok mikeb@, bluhm@, dlg@
Diffstat (limited to 'sys/netinet/ip_output.c')
-rw-r--r-- | sys/netinet/ip_output.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 960fc284624..b3d15f5973f 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_output.c,v 1.282 2015/06/07 01:25:27 krw Exp $ */ +/* $OpenBSD: ip_output.c,v 1.283 2015/06/16 11:09:40 mpi Exp $ */ /* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */ /* @@ -769,7 +769,7 @@ ip_fragment(struct mbuf *m, struct ifnet *ifp, u_long mtu) goto sendorfree; } m->m_pkthdr.len = mhlen + len; - m->m_pkthdr.rcvif = (struct ifnet *)0; + m->m_pkthdr.ph_ifidx = 0; mhip->ip_off = htons((u_int16_t)mhip->ip_off); mhip->ip_sum = 0; if ((ifp != NULL) && |