summaryrefslogtreecommitdiffstats
path: root/sys/netinet/if_ether.c
diff options
context:
space:
mode:
authorandre <andre@FreeBSD.org>2013-08-19 13:27:32 +0000
committerandre <andre@FreeBSD.org>2013-08-19 13:27:32 +0000
commit7cc6cc696c12dcee5a294f67527cebb28374c49e (patch)
tree4bf04ae1ab9f3c2b9ed6d2ce7bcd15edb4b3a1f0 /sys/netinet/if_ether.c
parenta84c641767af511112a0ead58df9bf7937868cde (diff)
downloadFreeBSD-src-7cc6cc696c12dcee5a294f67527cebb28374c49e.zip
FreeBSD-src-7cc6cc696c12dcee5a294f67527cebb28374c49e.tar.gz
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
Diffstat (limited to 'sys/netinet/if_ether.c')
-rw-r--r--sys/netinet/if_ether.c4
1 files changed, 4 insertions, 0 deletions
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;
OpenPOWER on IntegriCloud