From owner-svn-src-head@FreeBSD.ORG Thu Feb 23 00:59:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8344E1065673; Thu, 23 Feb 2012 00:59:22 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 588248FC12; Thu, 23 Feb 2012 00:59:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1N0xMoH076619; Thu, 23 Feb 2012 00:59:22 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1N0xM8B076615; Thu, 23 Feb 2012 00:59:22 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201202230059.q1N0xM8B076615@svn.freebsd.org> From: Andrew Thompson Date: Thu, 23 Feb 2012 00:59:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232014 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Feb 2012 00:59:22 -0000 Author: thompsa Date: Thu Feb 23 00:59:21 2012 New Revision: 232014 URL: http://svn.freebsd.org/changeset/base/232014 Log: bstp_input() always consumes the packet so remove the mbuf handling dance around it. Obtained from: OpenBSD (r1.37) Modified: head/sys/net/bridgestp.c head/sys/net/bridgestp.h head/sys/net/if_bridge.c Modified: head/sys/net/bridgestp.c ============================================================================== --- head/sys/net/bridgestp.c Thu Feb 23 00:52:27 2012 (r232013) +++ head/sys/net/bridgestp.c Thu Feb 23 00:59:21 2012 (r232014) @@ -446,7 +446,7 @@ bstp_pdu_flags(struct bstp_port *bp) return (flags); } -struct mbuf * +void bstp_input(struct bstp_port *bp, struct ifnet *ifp, struct mbuf *m) { struct bstp_state *bs = bp->bp_bs; @@ -456,7 +456,7 @@ bstp_input(struct bstp_port *bp, struct if (bp->bp_active == 0) { m_freem(m); - return (NULL); + return; } BSTP_LOCK(bs); @@ -521,7 +521,6 @@ out: BSTP_UNLOCK(bs); if (m) m_freem(m); - return (NULL); } static void Modified: head/sys/net/bridgestp.h ============================================================================== --- head/sys/net/bridgestp.h Thu Feb 23 00:52:27 2012 (r232013) +++ head/sys/net/bridgestp.h Thu Feb 23 00:59:21 2012 (r232014) @@ -392,6 +392,6 @@ int bstp_set_edge(struct bstp_port *, in int bstp_set_autoedge(struct bstp_port *, int); int bstp_set_ptp(struct bstp_port *, int); int bstp_set_autoptp(struct bstp_port *, int); -struct mbuf *bstp_input(struct bstp_port *, struct ifnet *, struct mbuf *); +void bstp_input(struct bstp_port *, struct ifnet *, struct mbuf *); #endif /* _KERNEL */ Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Thu Feb 23 00:52:27 2012 (r232013) +++ head/sys/net/if_bridge.c Thu Feb 23 00:59:21 2012 (r232014) @@ -2215,11 +2215,9 @@ bridge_input(struct ifnet *ifp, struct m /* Tap off 802.1D packets; they do not get forwarded. */ if (memcmp(eh->ether_dhost, bstp_etheraddr, ETHER_ADDR_LEN) == 0) { - m = bstp_input(&bif->bif_stp, ifp, m); - if (m == NULL) { - BRIDGE_UNLOCK(sc); - return (NULL); - } + bstp_input(&bif->bif_stp, ifp, m); /* consumes mbuf */ + BRIDGE_UNLOCK(sc); + return (NULL); } if ((bif->bif_flags & IFBIF_STP) &&