* bridge_rtnode_lookup: * * Look up a bridge route node for the specified destination. Compare the * vlan id or if zero then just return the first match. */
| 3000 | * vlan id or if zero then just return the first match. |
| 3001 | */ |
| 3002 | static struct bridge_rtnode * |
| 3003 | bridge_rtnode_lookup(struct bridge_softc *sc, const uint8_t *addr, uint16_t vlan) |
| 3004 | { |
| 3005 | struct bridge_rtnode *brt; |
| 3006 | uint32_t hash; |
| 3007 | int dir; |
| 3008 | |
| 3009 | BRIDGE_RT_LOCK_OR_NET_EPOCH_ASSERT(sc); |
| 3010 | |
| 3011 | hash = bridge_rthash(sc, addr); |
| 3012 | CK_LIST_FOREACH(brt, &sc->sc_rthash[hash], brt_hash) { |
| 3013 | dir = bridge_rtnode_addr_cmp(addr, brt->brt_addr); |
| 3014 | if (dir == 0 && (brt->brt_vlan == vlan || vlan == 0)) |
| 3015 | return (brt); |
| 3016 | if (dir > 0) |
| 3017 | return (NULL); |
| 3018 | } |
| 3019 | |
| 3020 | return (NULL); |
| 3021 | } |
| 3022 | |
| 3023 | /* |
| 3024 | * bridge_rtnode_insert: |
no test coverage detected