diff options
-rw-r--r-- | sys/netinet/ip_carp.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index f28eccd1ca3..5c620aae863 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_carp.c,v 1.65 2004/09/18 16:15:53 mcbride Exp $ */ +/* $OpenBSD: ip_carp.c,v 1.66 2004/10/05 18:08:41 mcbride Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff. All rights reserved. @@ -806,7 +806,9 @@ carp_send_ad(void *v) struct carp_softc *sc = v; struct carp_header *ch_ptr; struct mbuf *m; - int len, advbase, advskew; + int len, advbase, advskew, s; + + s = splsoftnet(); /* bow out if we've lost our UPness or RUNNINGuiness */ if ((sc->sc_ac.ac_if.if_flags & @@ -842,9 +844,7 @@ carp_send_ad(void *v) sc->sc_ac.ac_if.if_oerrors++; carpstats.carps_onomem++; /* XXX maybe less ? */ - if (advbase != 255 || advskew != 255) - timeout_add(&sc->sc_ad_tmo, tvtohz(&tv)); - return; + goto retry_later; } len = sizeof(*ip) + sizeof(ch); m->m_pkthdr.len = len; @@ -868,7 +868,7 @@ carp_send_ad(void *v) ch_ptr = (void *)ip + sizeof(*ip); bcopy(&ch, ch_ptr, sizeof(ch)); if (carp_prepare_ad(m, sc, ch_ptr)) - return; + goto retry_later; m->m_data += sizeof(*ip); ch_ptr->carp_cksum = carp_cksum(m, len - sizeof(*ip)); @@ -910,9 +910,7 @@ carp_send_ad(void *v) sc->sc_ac.ac_if.if_oerrors++; carpstats.carps_onomem++; /* XXX maybe less ? */ - if (advbase != 255 || advskew != 255) - timeout_add(&sc->sc_ad_tmo, tvtohz(&tv)); - return; + goto retry_later; } len = sizeof(*ip6) + sizeof(ch); m->m_pkthdr.len = len; @@ -936,7 +934,7 @@ carp_send_ad(void *v) ch_ptr = (void *)ip6 + sizeof(*ip6); bcopy(&ch, ch_ptr, sizeof(ch)); if (carp_prepare_ad(m, sc, ch_ptr)) - return; + goto retry_later; m->m_data += sizeof(*ip6); ch_ptr->carp_cksum = carp_cksum(m, len - sizeof(*ip6)); @@ -970,6 +968,8 @@ carp_send_ad(void *v) } #endif /* INET6 */ +retry_later: + splx(s); if (advbase != 255 || advskew != 255) timeout_add(&sc->sc_ad_tmo, tvtohz(&tv)); } |