From owner-svn-src-all@FreeBSD.ORG Thu Jun 20 07:30:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E656A7CC; Thu, 20 Jun 2013 07:30:13 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D8C801F5C; Thu, 20 Jun 2013 07:30:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5K7UDOm063873; Thu, 20 Jun 2013 07:30:13 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5K7UDAU063871; Thu, 20 Jun 2013 07:30:13 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201306200730.r5K7UDAU063871@svn.freebsd.org> From: Hiroki Sato Date: Thu, 20 Jun 2013 07:30:13 +0000 (UTC) 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 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2013 07:30:14 -0000 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);