diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2010-10-28 13:49:55 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2010-10-28 13:49:55 +0000 |
commit | 24c64c90c25711433236441e0509ebae8231f426 (patch) | |
tree | 13294cc6904c6ef8dbd7449ed5f236e9172a0235 /sys | |
parent | aa110b956fdc2a8f219a61129ab1da128cad8900 (diff) |
A function that only returns NULL should return void.
bstp_input() always consumes the packet so remove the mbuf handling
dance around it.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/bridgestp.c | 5 | ||||
-rw-r--r-- | sys/net/if_bridge.c | 7 | ||||
-rw-r--r-- | sys/net/if_bridge.h | 4 |
3 files changed, 7 insertions, 9 deletions
diff --git a/sys/net/bridgestp.c b/sys/net/bridgestp.c index 5cba8f9201d..666bb45acb0 100644 --- a/sys/net/bridgestp.c +++ b/sys/net/bridgestp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bridgestp.c,v 1.36 2008/09/10 14:01:23 blambert Exp $ */ +/* $OpenBSD: bridgestp.c,v 1.37 2010/10/28 13:49:54 claudio Exp $ */ /* * Copyright (c) 2000 Jason L. Wright (jason@thought.net) @@ -596,7 +596,7 @@ bstp_pdu_flags(struct bstp_port *bp) return (flags); } -struct mbuf * +void bstp_input(struct bstp_state *bs, struct bstp_port *bp, struct ether_header *eh, struct mbuf *m) { @@ -656,7 +656,6 @@ 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 6197e74aeec..85206689769 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bridge.c,v 1.184 2010/09/28 08:13:11 blambert Exp $ */ +/* $OpenBSD: if_bridge.c,v 1.185 2010/10/28 13:49:54 claudio Exp $ */ /* * Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net) @@ -1423,9 +1423,8 @@ bridge_input(struct ifnet *ifp, struct ether_header *eh, struct mbuf *m) if (m->m_flags & (M_BCAST | M_MCAST)) { /* Tap off 802.1D packets, they do not get forwarded */ if (bcmp(eh->ether_dhost, bstp_etheraddr, ETHER_ADDR_LEN) == 0) { - m = bstp_input(sc->sc_stp, ifl->bif_stp, eh, m); - if (m == NULL) - return (NULL); + bstp_input(sc->sc_stp, ifl->bif_stp, eh, m); + return (NULL); } /* diff --git a/sys/net/if_bridge.h b/sys/net/if_bridge.h index 546fd346e3c..1c77c842511 100644 --- a/sys/net/if_bridge.h +++ b/sys/net/if_bridge.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bridge.h,v 1.31 2006/12/11 22:11:48 reyk Exp $ */ +/* $OpenBSD: if_bridge.h,v 1.32 2010/10/28 13:49:54 claudio Exp $ */ /* * Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net) @@ -446,7 +446,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 *); -struct mbuf *bstp_input(struct bstp_state *, struct bstp_port *, +void 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 *); |