Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Jun 2013 07:30:13 +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-9@freebsd.org
Subject:   svn commit: r252023 - in stable/9/sys: net netinet
Message-ID:  <201306200730.r5K7UDAU063871@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hrs
Date: Thu Jun 20 07:30:13 2013
New Revision: 252023
URL: http://svnweb.freebsd.org/changeset/base/252023

Log:
  MFC r250523:
  
  Add IFF_MONITOR support to gre(4).
  
  Tested by:	Chip Marshall

Modified:
  stable/9/sys/net/if_gre.c
  stable/9/sys/netinet/ip_gre.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/net/if_gre.c
==============================================================================
--- stable/9/sys/net/if_gre.c	Thu Jun 20 07:29:42 2013	(r252022)
+++ stable/9/sys/net/if_gre.c	Thu Jun 20 07:30:13 2013	(r252023)
@@ -343,6 +343,12 @@ gre_output(struct ifnet *ifp, struct mbu
 		bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m);
 	}
 
+	if ((ifp->if_flags & IFF_MONITOR) != 0) {
+		m_freem(m);
+		error = ENETDOWN;
+		goto end;
+	}
+
 	m->m_flags &= ~(M_BCAST|M_MCAST);
 
 	if (sc->g_proto == IPPROTO_MOBILE) {

Modified: stable/9/sys/netinet/ip_gre.c
==============================================================================
--- stable/9/sys/netinet/ip_gre.c	Thu Jun 20 07:29:42 2013	(r252022)
+++ stable/9/sys/netinet/ip_gre.c	Thu Jun 20 07:30:13 2013	(r252023)
@@ -205,6 +205,11 @@ gre_input2(struct mbuf *m ,int hlen, u_c
 		bpf_mtap2(GRE2IFP(sc)->if_bpf, &af, sizeof(af), m);
 	}
 
+	if ((GRE2IFP(sc)->if_flags & IFF_MONITOR) != 0) {
+		m_freem(m);
+		return(NULL);
+	}
+
 	m->m_pkthdr.rcvif = GRE2IFP(sc);
 
 	netisr_queue(isr, m);
@@ -289,6 +294,11 @@ gre_mobile_input(struct mbuf *m, int hle
 		bpf_mtap2(GRE2IFP(sc)->if_bpf, &af, sizeof(af), m);
 	}
 
+	if ((GRE2IFP(sc)->if_flags & IFF_MONITOR) != 0) {
+		m_freem(m);
+		return;
+	}
+
 	m->m_pkthdr.rcvif = GRE2IFP(sc);
 
 	netisr_queue(NETISR_IP, m);



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