summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/net/bridgestp.c7
-rw-r--r--sys/net/if_bridge.c7
-rw-r--r--sys/net/if_bridge.h4
3 files changed, 10 insertions, 8 deletions
diff --git a/sys/net/bridgestp.c b/sys/net/bridgestp.c
index bfc282c9a4c..70c4e63511a 100644
--- a/sys/net/bridgestp.c
+++ b/sys/net/bridgestp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bridgestp.c,v 1.40 2011/07/09 04:53:33 henning Exp $ */
+/* $OpenBSD: bridgestp.c,v 1.41 2012/09/20 14:10:18 mpf Exp $ */
/*
* Copyright (c) 2000 Jason L. Wright (jason@thought.net)
@@ -594,7 +594,7 @@ bstp_pdu_flags(struct bstp_port *bp)
return (flags);
}
-void
+struct mbuf *
bstp_input(struct bstp_state *bs, struct bstp_port *bp,
struct ether_header *eh, struct mbuf *m)
{
@@ -602,7 +602,7 @@ bstp_input(struct bstp_state *bs, struct bstp_port *bp,
u_int16_t len;
if (bs == NULL || bp == NULL || bp->bp_active == 0)
- goto out;
+ return (m);
len = ntohs(eh->ether_type);
if (len < sizeof(tpdu))
@@ -654,6 +654,7 @@ bstp_input(struct bstp_state *bs, struct bstp_port *bp,
out:
if (m)
m_freem(m);
+ return (NULL);
}
void
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index 052cd6c626e..54503a16dc6 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bridge.c,v 1.195 2012/09/20 10:25:03 blambert Exp $ */
+/* $OpenBSD: if_bridge.c,v 1.196 2012/09/20 14:10:18 mpf Exp $ */
/*
* Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net)
@@ -1418,8 +1418,9 @@ bridge_input(struct ifnet *ifp, struct ether_header *eh, struct mbuf *m)
== 0) {
if (eh->ether_dhost[ETHER_ADDR_LEN - 1] == 0) {
/* STP traffic */
- bstp_input(sc->sc_stp, ifl->bif_stp, eh, m);
- return (NULL);
+ if ((m = bstp_input(sc->sc_stp, ifl->bif_stp,
+ eh, m)) == NULL);
+ return (NULL);
} else if (eh->ether_dhost[ETHER_ADDR_LEN - 1] <= 0xf) {
m_freem(m);
return (NULL);
diff --git a/sys/net/if_bridge.h b/sys/net/if_bridge.h
index 4d393b74ff3..68f3047b1f2 100644
--- a/sys/net/if_bridge.h
+++ b/sys/net/if_bridge.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bridge.h,v 1.34 2010/11/20 14:23:09 fgsch Exp $ */
+/* $OpenBSD: if_bridge.h,v 1.35 2012/09/20 14:10:18 mpf Exp $ */
/*
* Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net)
@@ -444,7 +444,7 @@ void bstp_stop(struct bstp_state *);
int bstp_ioctl(struct ifnet *, u_long, caddr_t);
struct bstp_port *bstp_add(struct bstp_state *, struct ifnet *);
void bstp_delete(struct bstp_port *);
-void bstp_input(struct bstp_state *, struct bstp_port *,
+struct mbuf *bstp_input(struct bstp_state *, struct bstp_port *,
struct ether_header *, struct mbuf *);
void bstp_ifstate(void *);
u_int8_t bstp_getstate(struct bstp_state *, struct bstp_port *);