From 7cc6cc696c12dcee5a294f67527cebb28374c49e Mon Sep 17 00:00:00 2001 From: andre Date: Mon, 19 Aug 2013 13:27:32 +0000 Subject: Add m_clrprotoflags() to clear protocol specific mbuf flags at up and downwards layer crossings. Consistently use it within IP, IPv6 and ethernet protocols. Discussed with: trociny, glebius --- sys/netinet/if_ether.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sys/netinet/if_ether.c') diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 675e0dd..9660edc 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -281,6 +281,7 @@ arprequest(struct ifnet *ifp, const struct in_addr *sip, sa.sa_family = AF_ARP; sa.sa_len = 2; m->m_flags |= M_BCAST; + m_clrprotoflags(m); /* Avoid confusing lower layers. */ (*ifp->if_output)(ifp, m, &sa, NULL); ARPSTAT_INC(txrequests); } @@ -784,6 +785,8 @@ match: for (; m_hold != NULL; m_hold = m_hold_next) { m_hold_next = m_hold->m_nextpkt; m_hold->m_nextpkt = NULL; + /* Avoid confusing lower layers. */ + m_clrprotoflags(m_hold); (*ifp->if_output)(ifp, m_hold, &sa, NULL); } } else @@ -888,6 +891,7 @@ reply: m->m_pkthdr.rcvif = NULL; sa.sa_family = AF_ARP; sa.sa_len = 2; + m_clrprotoflags(m); /* Avoid confusing lower layers. */ (*ifp->if_output)(ifp, m, &sa, NULL); ARPSTAT_INC(txreplies); return; -- cgit v1.1