Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Oct 2014 23:29:45 +0000 (UTC)
From:      Hiroki Sato <hrs@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r272859 - in stable/10/sys: netinet netinet6
Message-ID:  <201410092329.s99NTj7E075998@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410092329.s99NTj7E075998>