From 2ba5413f7793d10c06891b3733feeceecf03be87 Mon Sep 17 00:00:00 2001 From: hrs Date: Thu, 9 Oct 2014 23:29:44 +0000 Subject: [PATCH] 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(). git-svn-id: svn://svn.freebsd.org/base/stable/10@272859 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/netinet/in_gif.c | 2 ++ sys/netinet6/in6_gif.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sys/netinet/in_gif.c b/sys/netinet/in_gif.c index 45c861901..abaf9b171 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 7fdaf1630..97bc4a5c9 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. -- 2.45.0