summaryrefslogtreecommitdiff
path: root/sys/netinet6/frag6.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2015-06-16 11:09:41 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2015-06-16 11:09:41 +0000
commit3a3f3f5b2a66fdcf27f621f80a6d0a6d22bfaace (patch)
tree173fe4df0244a96c60ce236617fe5b7c539ad2f1 /sys/netinet6/frag6.c
parent913f86006f0c78d29161101d7aad233f8f4668df (diff)
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/netinet6/frag6.c')
-rw-r--r--sys/netinet6/frag6.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c
index bff3dc8da94..1d43f3f2aea 100644
--- a/sys/netinet6/frag6.c
+++ b/sys/netinet6/frag6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: frag6.c,v 1.59 2014/12/08 10:51:00 mpi Exp $ */
+/* $OpenBSD: frag6.c,v 1.60 2015/06/16 11:09:40 mpi Exp $ */
/* $KAME: frag6.c,v 1.40 2002/05/27 21:40:31 itojun Exp $ */
/*
@@ -203,7 +203,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto)
#else
/* we are violating the spec, this is not the destination interface */
if ((m->m_flags & M_PKTHDR) != 0)
- dstifp = m->m_pkthdr.rcvif;
+ dstifp = if_get(m->m_pkthdr.ph_ifidx);
#endif
/* jumbo payload can't contain a fragment header */