bstp_input() always consumes the packet so remove the mbuf handling dance
around it. Obtained from: OpenBSD (r1.37)
This commit is contained in:
parent
19befced93
commit
4661f8627c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=232014
@ -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 ifnet *ifp, struct mbuf *m)
|
||||
|
||||
if (bp->bp_active == 0) {
|
||||
m_freem(m);
|
||||
return (NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
BSTP_LOCK(bs);
|
||||
@ -521,7 +521,6 @@ bstp_input(struct bstp_port *bp, struct ifnet *ifp, struct mbuf *m)
|
||||
BSTP_UNLOCK(bs);
|
||||
if (m)
|
||||
m_freem(m);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -392,6 +392,6 @@ int bstp_set_edge(struct bstp_port *, int);
|
||||
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 */
|
||||
|
@ -2215,11 +2215,9 @@ bridge_input(struct ifnet *ifp, struct mbuf *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) &&
|
||||
|
Loading…
Reference in New Issue
Block a user