summaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorRyan Thomas McBride <mcbride@cvs.openbsd.org>2004-12-08 06:57:56 +0000
committerRyan Thomas McBride <mcbride@cvs.openbsd.org>2004-12-08 06:57:56 +0000
commita3a34c3c6b12a2a3e9461379fbe1d73dc712b8ae (patch)
tree75988a556304c25e04a9dafa629848cf1264e912 /sys/netinet
parentcf2a4811a40c723ce40bfe6bade0eed5883ed287 (diff)
Check if_type in carp_carpdev_state() to make sure we're not
dealing with a carp interface.
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_carp.c11
-rw-r--r--sys/netinet/ip_carp.h4
2 files changed, 10 insertions, 5 deletions
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index fdc0e5c7aab..2179a8868b0 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_carp.c,v 1.73 2004/12/07 20:38:47 mcbride Exp $ */
+/* $OpenBSD: ip_carp.c,v 1.74 2004/12/08 06:57:55 mcbride Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff. All rights reserved.
@@ -2041,11 +2041,16 @@ carp_set_state(struct carp_softc *sc, int state)
}
void
-carp_carpdev_state(void *v)
+carp_carpdev_state(struct ifnet *ifp)
{
- struct carp_if *cif = v;
+ struct carp_if *cif;
struct carp_softc *sc;
+ if (ifp->if_type == IFT_CARP)
+ return;
+
+ cif = (struct carp_if *)ifp->if_carp;
+
TAILQ_FOREACH(sc, &cif->vhif_vrs, sc_list) {
if (sc->sc_carpdev->if_link_state == LINK_STATE_DOWN ||
!(sc->sc_carpdev->if_flags & IFF_UP)) {
diff --git a/sys/netinet/ip_carp.h b/sys/netinet/ip_carp.h
index a46b26fd207..0c6720671f3 100644
--- a/sys/netinet/ip_carp.h
+++ b/sys/netinet/ip_carp.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_carp.h,v 1.9 2004/12/07 20:38:47 mcbride Exp $ */
+/* $OpenBSD: ip_carp.h,v 1.10 2004/12/08 06:57:55 mcbride Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff. All rights reserved.
@@ -153,7 +153,7 @@ struct carpreq {
#ifdef _KERNEL
void carp_ifdetach (struct ifnet *);
void carp_proto_input (struct mbuf *, ...);
-void carp_carpdev_state(void *);
+void carp_carpdev_state(struct ifnet *);
int carp6_proto_input(struct mbuf **, int *, int);
int carp_output(struct ifnet *, struct mbuf *, struct sockaddr *,
struct rtentry *);