summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhrs <hrs@FreeBSD.org>2014-10-09 23:29:44 +0000
committerhrs <hrs@FreeBSD.org>2014-10-09 23:29:44 +0000
commitfee8b9f9924d7ba5fcdfc364af079bc02ded5b20 (patch)
tree571002a4da0d9d39e89399af7d77473e994d866d
parent26a421d9ed86751e304428543563be0b61220bd2 (diff)
downloadFreeBSD-src-fee8b9f9924d7ba5fcdfc364af079bc02ded5b20.zip
FreeBSD-src-fee8b9f9924d7ba5fcdfc364af079bc02ded5b20.tar.gz
MFC r269054:
Fix EtherIP. TOS field must be initialized when the inner protocol is PF_LINK, and multicast/broadcast flag should always be dropped because the outer protocol uses unicast even when the inner address is not for unicast. It had been broken since r236951 when gif_output() started to use IFQ_HANDOFF().
-rw-r--r--sys/netinet/in_gif.c2
-rw-r--r--sys/netinet6/in6_gif.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/sys/netinet/in_gif.c b/sys/netinet/in_gif.c
index 45c8619..abaf9b1 100644
--- a/sys/netinet/in_gif.c
+++ b/sys/netinet/in_gif.c
@@ -169,6 +169,7 @@ in_gif_output(struct ifnet *ifp, int family, struct mbuf *m)
return ENOBUFS;
bcopy(&eiphdr, mtod(m, struct etherip_header *),
sizeof(struct etherip_header));
+ tos = 0;
break;
default:
@@ -256,6 +257,7 @@ in_gif_output(struct ifnet *ifp, int family, struct mbuf *m)
#endif
}
+ m->m_flags &= ~(M_BCAST|M_MCAST);
error = ip_output(m, NULL, &sc->gif_ro, 0, NULL, NULL);
if (!(GIF2IFP(sc)->if_flags & IFF_LINK0) &&
diff --git a/sys/netinet6/in6_gif.c b/sys/netinet6/in6_gif.c
index 7fdaf16..97bc4a5 100644
--- a/sys/netinet6/in6_gif.c
+++ b/sys/netinet6/in6_gif.c
@@ -174,6 +174,7 @@ in6_gif_output(struct ifnet *ifp,
return ENOBUFS;
bcopy(&eiphdr, mtod(m, struct etherip_header *),
sizeof(struct etherip_header));
+ itos = 0;
break;
default:
@@ -264,6 +265,7 @@ in6_gif_output(struct ifnet *ifp,
#endif
}
+ m->m_flags &= ~(M_BCAST|M_MCAST);
#ifdef IPV6_MINMTU
/*
* force fragmentation to minimum MTU, to avoid path MTU discovery.
OpenPOWER on IntegriCloud