From 9d6daec549bf5305311f797a90baec7338ba9c88 Mon Sep 17 00:00:00 2001 From: Ryan Thomas McBride Date: Mon, 24 May 2004 18:54:48 +0000 Subject: 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! --- sys/netinet/ip_carp.c | 4 ++-- 1 file 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); -- cgit v1.2.3