diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2018-01-10 23:50:40 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2018-01-10 23:50:40 +0000 |
commit | 75b71ecc66ad45c3d4cc5412f23ddcdbec877f53 (patch) | |
tree | f4dd3e706f791ac547d9773ca789e040989f2d05 /sys/net/if_bridge.c | |
parent | 319530702ba290369e59c1c58266f18ac8430dfd (diff) |
get rid of struct carp_if by moving the srpl into struct ifnet if_carp.
currently carp uses a struct carp_if to hold an srp list head, which
is accessed by both if_carp in struct ifnet, and via the if input
handlers list.
this gets rid of some indirection by making if_carp itself the list
head, rather than a pointer to the list head via a struct carp_if.
it also makes accessing the list consistent by only using if_carp
to get to it.
ok mpi@
Diffstat (limited to 'sys/net/if_bridge.c')
-rw-r--r-- | sys/net/if_bridge.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 425d90fb0bc..fa37dfd12e9 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bridge.c,v 1.300 2018/01/09 15:24:24 bluhm Exp $ */ +/* $OpenBSD: if_bridge.c,v 1.301 2018/01/10 23:50:39 dlg Exp $ */ /* * Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net) @@ -1108,8 +1108,8 @@ bridge_process(struct ifnet *ifp, struct mbuf *m) ac = (struct arpcom *)ifl->ifp; if (bcmp(ac->ac_enaddr, eh->ether_dhost, ETHER_ADDR_LEN) == 0 #if NCARP > 0 - || (ifl->ifp->if_carp && carp_ourether(ifl->ifp->if_carp, - (u_int8_t *)&eh->ether_dhost) != NULL) + || (!SRPL_EMPTY_LOCKED(&ifl->ifp->if_carp) && + !carp_ourether(ifl->ifp, eh->ether_dhost)) #endif ) { if (srcifl->bif_flags & IFBIF_LEARNING) @@ -1131,8 +1131,8 @@ bridge_process(struct ifnet *ifp, struct mbuf *m) } if (bcmp(ac->ac_enaddr, eh->ether_shost, ETHER_ADDR_LEN) == 0 #if NCARP > 0 - || (ifl->ifp->if_carp && carp_ourether(ifl->ifp->if_carp, - (u_int8_t *)&eh->ether_shost) != NULL) + || (!SRPL_EMPTY_LOCKED(&ifl->ifp->if_carp) && + !carp_ourether(ifl->ifp, eh->ether_shost)) #endif ) { m_freem(m); |