Skip to content

Commit

Permalink
carp: BGL -> CARP global token
Browse files Browse the repository at this point in the history
  • Loading branch information
Sepherosa Ziehau committed Jan 22, 2012
1 parent f534cac commit 0eb2639
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 42 deletions.
16 changes: 8 additions & 8 deletions sys/net/if_ethersubr.c
Expand Up @@ -335,14 +335,14 @@ ether_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
#ifdef CARP
if (ifp->if_carp) {
/*
* Hold BGL and recheck ifp->if_carp
* Hold CARP token and recheck ifp->if_carp
*/
get_mplock();
carp_gettok();
if (ifp->if_carp && (error = carp_output(ifp, m, dst, NULL))) {
rel_mplock();
carp_reltok();
goto bad;
}
rel_mplock();
carp_reltok();
}
#endif

Expand Down Expand Up @@ -1019,14 +1019,14 @@ ether_demux_oncpu(struct ifnet *ifp, struct mbuf *m)
*/
if (ifp->if_carp) {
/*
* Hold BGL and recheck ifp->if_carp
* Hold CARP token and recheck ifp->if_carp
*/
get_mplock();
carp_gettok();
if (ifp->if_carp && carp_forus(ifp->if_carp, eh->ether_dhost)) {
rel_mplock();
carp_reltok();
goto post_stats;
}
rel_mplock();
carp_reltok();
}
#endif

Expand Down
6 changes: 3 additions & 3 deletions sys/netinet/if_ether.c
Expand Up @@ -871,14 +871,14 @@ in_arpinput(struct mbuf *m)
myaddr.s_addr = INADDR_ANY;
#ifdef CARP
if (ifp->if_carp != NULL) {
get_mplock();
carp_gettok();
if (ifp->if_carp != NULL &&
carp_iamatch(ifp->if_carp, &itaddr, &isaddr, &enaddr)) {
rel_mplock();
carp_reltok();
myaddr = itaddr;
goto match;
}
rel_mplock();
carp_reltok();
}
#endif

Expand Down

0 comments on commit 0eb2639

Please sign in to comment.