summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Thomas McBride <mcbride@cvs.openbsd.org>2004-05-24 18:54:48 +0000
committerRyan Thomas McBride <mcbride@cvs.openbsd.org>2004-05-24 18:54:48 +0000
commit9d6daec549bf5305311f797a90baec7338ba9c88 (patch)
tree5d4c702f8ab3b6d42be32a653d6b0783ced3f96e
parent5e09da125ab863a93f8bc2dd43c6bff73466445f (diff)
Check for sc->sc_ifp != NULL in carp_setroute(). Running dhclient on the
carp interface won't work, but it doesn't mean we should panic the box!
-rw-r--r--sys/netinet/ip_carp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index c6ef7b9d919..e9c643e6f85 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_carp.c,v 1.52 2004/05/16 02:06:10 mcbride Exp $ */
+/* $OpenBSD: ip_carp.c,v 1.53 2004/05/24 18:54:47 mcbride Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff. All rights reserved.
@@ -276,7 +276,7 @@ carp_setroute(struct carp_softc *sc, int cmd)
s = splnet();
TAILQ_FOREACH(ifa, &sc->sc_ac.ac_if.if_addrlist, ifa_list) {
- if (ifa->ifa_addr->sa_family == AF_INET) {
+ if (ifa->ifa_addr->sa_family == AF_INET && sc->sc_ifp != NULL) {
int count = carp_addrcount(
(struct carp_if *)sc->sc_ifp->if_carp,
ifatoia(ifa), CARP_COUNT_MASTER);