svn commit: r269054 - in head/sys: netinet netinet6
Hiroki Sato
hrs at FreeBSD.org
Thu Jul 24 10:42:48 UTC 2014
Author: hrs
Date: Thu Jul 24 10:42:47 2014
New Revision: 269054
URL: http://svnweb.freebsd.org/changeset/base/269054
Log:
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().
Modified:
head/sys/netinet/in_gif.c
head/sys/netinet6/in6_gif.c
Modified: head/sys/netinet/in_gif.c
==============================================================================
--- head/sys/netinet/in_gif.c Thu Jul 24 10:25:42 2014 (r269053)
+++ head/sys/netinet/in_gif.c Thu Jul 24 10:42:47 2014 (r269054)
@@ -170,6 +170,7 @@ in_gif_output(struct ifnet *ifp, int fam
return ENOBUFS;
bcopy(&eiphdr, mtod(m, struct etherip_header *),
sizeof(struct etherip_header));
+ tos = 0;
break;
default:
@@ -257,6 +258,7 @@ in_gif_output(struct ifnet *ifp, int fam
#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) &&
Modified: head/sys/netinet6/in6_gif.c
==============================================================================
--- head/sys/netinet6/in6_gif.c Thu Jul 24 10:25:42 2014 (r269053)
+++ head/sys/netinet6/in6_gif.c Thu Jul 24 10:42:47 2014 (r269054)
@@ -176,6 +176,7 @@ in6_gif_output(struct ifnet *ifp,
return ENOBUFS;
bcopy(&eiphdr, mtod(m, struct etherip_header *),
sizeof(struct etherip_header));
+ itos = 0;
break;
default:
@@ -266,6 +267,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.
More information about the svn-src-head
mailing list