diff options
author | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2005-11-27 15:46:05 +0000 |
---|---|---|
committer | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2005-11-27 15:46:05 +0000 |
commit | 95354acda5611ca26c328a43628b92d2603c444d (patch) | |
tree | 111b6ec29cd2555958cd9eac6c6830260d96a3fb /sys/net | |
parent | 1d293323fa550f4affc1ca7eee249622433fc643 (diff) |
Attempt to accept a packet only once when operating in failover mode.
Makes trunk usable with hubs or switches which don't have actual trunk support.
ok reyk@
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if_trunk.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/sys/net/if_trunk.c b/sys/net/if_trunk.c index 67a4efc2f10..72e562ee6ef 100644 --- a/sys/net/if_trunk.c +++ b/sys/net/if_trunk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_trunk.c,v 1.12 2005/11/27 09:29:42 mcbride Exp $ */ +/* $OpenBSD: if_trunk.c,v 1.13 2005/11/27 15:46:04 mcbride Exp $ */ /* * Copyright (c) 2005 Reyk Floeter <reyk@vantronix.net> @@ -1160,9 +1160,24 @@ trunk_fail_input(struct trunk_softc *tr, struct trunk_port *tp, struct ether_header *eh, struct mbuf *m) { struct ifnet *ifp = &tr->tr_ac.ac_if; + struct trunk_port *tmp_tp; + + if (tp == tr->tr_primary) { + m->m_pkthdr.rcvif = ifp; + return (0); + } - /* Just pass in the packet to our trunk device */ - m->m_pkthdr.rcvif = ifp; + if (tr->tr_primary->tp_link_state == LINK_STATE_DOWN) { + tmp_tp = trunk_link_active(tr, NULL); + /* + * If tmp_tp is null, we've recieved a packet when all + * our links are down. Weird, but process it anyways. + */ + if ((tmp_tp == NULL || tmp_tp == tp)) { + m->m_pkthdr.rcvif = ifp; + return (0); + } + } - return (0); + return (ENETDOWN); } |