summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
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/netinet6
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/netinet6')
-rw-r--r--sys/netinet6/ip6_mroute.c1
-rw-r--r--sys/netinet6/mld6.c2
-rw-r--r--sys/netinet6/nd6.c3
-rw-r--r--sys/netinet6/send.c2
4 files changed, 5 insertions, 3 deletions
diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c
index 194aaf5..40c8c44 100644
--- a/sys/netinet6/ip6_mroute.c
+++ b/sys/netinet6/ip6_mroute.c
@@ -1648,6 +1648,7 @@ phyint_send(struct ip6_hdr *ip6, struct mif6 *mifp, struct mbuf *m)
* We just call if_output instead of nd6_output here, since
* we need no ND for a multicast forwarded packet...right?
*/
+ m_clrprotoflags(m); /* Avoid confusing lower layers. */
error = (*ifp->if_output)(ifp, mb_copy,
(struct sockaddr *)&dst6, NULL);
#ifdef MRT6DEBUG
diff --git a/sys/netinet6/mld6.c b/sys/netinet6/mld6.c
index 560e8d6..683a0d5 100644
--- a/sys/netinet6/mld6.c
+++ b/sys/netinet6/mld6.c
@@ -3098,7 +3098,7 @@ mld_dispatch_packet(struct mbuf *m)
}
mld_scrub_context(m0);
- m->m_flags &= ~(M_PROTOFLAGS);
+ m_clrprotoflags(m);
m0->m_pkthdr.rcvif = V_loif;
ip6 = mtod(m0, struct ip6_hdr *);
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index 7dcf2e1..7755da1 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -2082,8 +2082,7 @@ nd6_output_lle(struct ifnet *ifp, struct ifnet *origifp, struct mbuf *m0,
}
return (error);
}
- /* Reset layer specific mbuf flags to avoid confusing lower layers. */
- m->m_flags &= ~(M_PROTOFLAGS);
+ m_clrprotoflags(m); /* Avoid confusing lower layers. */
if ((ifp->if_flags & IFF_LOOPBACK) != 0) {
return ((*ifp->if_output)(origifp, m, (struct sockaddr *)dst,
NULL));
diff --git a/sys/netinet6/send.c b/sys/netinet6/send.c
index 5624366..233abdb 100644
--- a/sys/netinet6/send.c
+++ b/sys/netinet6/send.c
@@ -180,6 +180,8 @@ send_output(struct mbuf *m, struct ifnet *ifp, int direction)
dst.sin6_len = sizeof(dst);
dst.sin6_addr = ip6->ip6_dst;
+ m_clrprotoflags(m); /* Avoid confusing lower layers. */
+
/*
* Output the packet as nd6.c:nd6_output_lle() would do.
* The mbuf is always consumed, so we do not have to care
OpenPOWER on IntegriCloud