diff options
| author | Poul-Henning Kamp <phk@FreeBSD.org> | 2002-10-16 09:00:53 +0000 |
|---|---|---|
| committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2002-10-16 09:00:53 +0000 |
| commit | c6943100485233f1b65d0e4a774d0dd7a9f43d31 (patch) | |
| tree | 9fa12b045d20749f873c92ceb77cbc8c9a15c624 /sys | |
| parent | 1eaae5cbe898108880badb551f4c864bc3bd7caf (diff) | |
Notes
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/net/bridge.c | 20 | ||||
| -rw-r--r-- | sys/net/if_ethersubr.c | 27 |
2 files changed, 25 insertions, 22 deletions
diff --git a/sys/net/bridge.c b/sys/net/bridge.c index 1a59cee29a5f3..5c8e456c6c281 100644 --- a/sys/net/bridge.c +++ b/sys/net/bridge.c @@ -593,16 +593,16 @@ bdg_timeout(void *dummy) if (l > HASH_SIZE) l = HASH_SIZE ; - for (i=0; i<n_clusters; i++) { - bdg_hash_table *bdg_table = clusters[i].ht; - for (; age_index < l ; age_index++) - if (bdg_table[age_index].used) - bdg_table[age_index].used = 0 ; - else if (bdg_table[age_index].name) { - /* printf("xx flushing stale entry %d\n", age_index); */ - bdg_table[age_index].name = NULL ; - } - } + for (i=0; i<n_clusters; i++) { + bdg_hash_table *bdg_table = clusters[i].ht; + for (; age_index < l ; age_index++) + if (bdg_table[age_index].used) + bdg_table[age_index].used = 0 ; + else if (bdg_table[age_index].name) { + /* printf("xx flushing stale entry %d\n", age_index); */ + bdg_table[age_index].name = NULL ; + } + } if (age_index >= HASH_SIZE) age_index = 0 ; diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 6f0e1dfc28e10..5db15050efcd2 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -672,18 +672,21 @@ ether_demux(ifp, eh, m) if (rule) /* packet was already bridged */ goto post_stats; - if (! (BDG_ACTIVE(ifp) ) ) - /* Discard packet if upper layers shouldn't see it because it was - unicast to a different Ethernet address. If the driver is working - properly, then this situation can only happen when the interface - is in promiscuous mode. */ - if ((ifp->if_flags & IFF_PROMISC) != 0 - && (eh->ether_dhost[0] & 1) == 0 - && bcmp(eh->ether_dhost, - IFP2AC(ifp)->ac_enaddr, ETHER_ADDR_LEN) != 0 - && (ifp->if_flags & IFF_PPROMISC) == 0) { - m_freem(m); - return; + if (!(BDG_ACTIVE(ifp))) { + /* + * Discard packet if upper layers shouldn't see it because it + * was unicast to a different Ethernet address. If the driver + * is working properly, then this situation can only happen + * when the interface is in promiscuous mode. + */ + if ((ifp->if_flags & IFF_PROMISC) != 0 + && (eh->ether_dhost[0] & 1) == 0 + && bcmp(eh->ether_dhost, + IFP2AC(ifp)->ac_enaddr, ETHER_ADDR_LEN) != 0 + && (ifp->if_flags & IFF_PPROMISC) == 0) { + m_freem(m); + return; + } } /* Discard packet if interface is not up */ |
