From 3a3f3f5b2a66fdcf27f621f80a6d0a6d22bfaace Mon Sep 17 00:00:00 2001 From: Martin Pieuchot Date: Tue, 16 Jun 2015 11:09:41 +0000 Subject: 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@ --- sys/netinet/tcp_subr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/netinet/tcp_subr.c') diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 3637eefcadb..12788eb3246 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_subr.c,v 1.142 2015/05/13 10:42:46 jsg Exp $ */ +/* $OpenBSD: tcp_subr.c,v 1.143 2015/06/16 11:09:40 mpi Exp $ */ /* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */ /* @@ -394,7 +394,7 @@ tcp_respond(struct tcpcb *tp, caddr_t template, struct tcphdr *th0, m->m_len = tlen; m->m_pkthdr.len = tlen; - m->m_pkthdr.rcvif = (struct ifnet *) 0; + m->m_pkthdr.ph_ifidx = 0; m->m_pkthdr.csum_flags |= M_TCP_CSUM_OUT; /* force routing table */ -- cgit v1.2.3