summaryrefslogtreecommitdiff
path: root/sys/dev/mii/mii_physubr.c
diff options
context:
space:
mode:
authorRyan Thomas McBride <mcbride@cvs.openbsd.org>2004-04-28 00:28:44 +0000
committerRyan Thomas McBride <mcbride@cvs.openbsd.org>2004-04-28 00:28:44 +0000
commit6f8c06f8ef514939747639afb8d5cbd5b1b553e6 (patch)
tree5f8a5509b44e88d1267c482bcf63e9e37a1b2d0a /sys/dev/mii/mii_physubr.c
parent75b55077f740c68d8b550e2c7ab6eb3ef8970d16 (diff)
Make carp(4) aware of its physical interface:
- If the physical interface goes down or the link goes down, the carp interface goes down as well. - We treat this like the preemption holdoff with pfsync. So if one of the carp interfaces is known to be bad (because the physical interface it's associated with is bad), all the other carp interfaces back off: they won't preempt, and their advskew goes to 240. ok cedric@
Diffstat (limited to 'sys/dev/mii/mii_physubr.c')
-rw-r--r--sys/dev/mii/mii_physubr.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/dev/mii/mii_physubr.c b/sys/dev/mii/mii_physubr.c
index 7864194fd99..309dc3d73f5 100644
--- a/sys/dev/mii/mii_physubr.c
+++ b/sys/dev/mii/mii_physubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mii_physubr.c,v 1.15 2003/03/11 18:28:45 jason Exp $ */
+/* $OpenBSD: mii_physubr.c,v 1.16 2004/04/28 00:28:43 mcbride Exp $ */
/* $NetBSD: mii_physubr.c,v 1.20 2001/04/13 23:30:09 thorpej Exp $ */
/*-
@@ -57,6 +57,13 @@
#include <dev/mii/mii.h>
#include <dev/mii/miivar.h>
+#include "carp.h"
+#if NCARP > 0
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet/ip_carp.h>
+#endif
+
/*
* Media to register setting conversion table. Order matters.
* XXX 802.3 doesn't specify ANAR or ANLPAR bits for 1000base.
@@ -332,6 +339,10 @@ mii_phy_statusmsg(sc)
s = splnet();
rt_ifmsg(ifp);
splx(s);
+#if NCARP > 0
+ if (ifp->if_carp)
+ carp_carpdev_state(ifp->if_carp);
+#endif
}
}