svn commit: r272859 - in stable/10/sys: netinet netinet6

Hiroki Sato hrs at FreeBSD.org
Thu Oct 9 23:29:46 UTC 2014


Author: hrs
Date: Thu Oct  9 23:29:44 2014
New Revision: 272859
URL: https://svnweb.freebsd.org/changeset/base/272859

Log:
  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().

Modified:
  stable/10/sys/netinet/in_gif.c
  stable/10/sys/netinet6/in6_gif.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/netinet/in_gif.c
==============================================================================
--- stable/10/sys/netinet/in_gif.c	Thu Oct  9 23:28:04 2014	(r272858)
+++ stable/10/sys/netinet/in_gif.c	Thu Oct  9 23:29:44 2014	(r272859)
@@ -169,6 +169,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:
@@ -256,6 +257,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: stable/10/sys/netinet6/in6_gif.c
==============================================================================
--- stable/10/sys/netinet6/in6_gif.c	Thu Oct  9 23:28:04 2014	(r272858)
+++ stable/10/sys/netinet6/in6_gif.c	Thu Oct  9 23:29:44 2014	(r272859)
@@ -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.


More information about the svn-src-stable-10 mailing list