Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netinet carp should call if_link_state_change instead of...
details: https://anonhg.NetBSD.org/src/rev/0d9aab4988ae
branches: trunk
changeset: 353574:0d9aab4988ae
user: roy <roy%NetBSD.org@localhost>
date: Fri May 12 09:22:01 2017 +0000
description:
carp should call if_link_state_change instead of affecting
if_link_state directly.
diffstat:
sys/netinet/ip_carp.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diffs (48 lines):
diff -r fa6a9efb3b6c -r 0d9aab4988ae sys/netinet/ip_carp.c
--- a/sys/netinet/ip_carp.c Fri May 12 08:55:38 2017 +0000
+++ b/sys/netinet/ip_carp.c Fri May 12 09:22:01 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_carp.c,v 1.87 2017/04/19 03:23:06 ozaki-r Exp $ */
+/* $NetBSD: ip_carp.c,v 1.88 2017/05/12 09:22:01 roy Exp $ */
/* $OpenBSD: ip_carp.c,v 1.113 2005/11/04 08:11:54 mcbride Exp $ */
/*
@@ -33,7 +33,7 @@
#endif
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_carp.c,v 1.87 2017/04/19 03:23:06 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_carp.c,v 1.88 2017/05/12 09:22:01 roy Exp $");
/*
* TODO:
@@ -2172,6 +2172,8 @@
carp_set_state(struct carp_softc *sc, int state)
{
static const char *carp_states[] = { CARP_STATES };
+ int link_state;
+
if (sc->sc_state == state)
return;
@@ -2180,16 +2182,16 @@
sc->sc_state = state;
switch (state) {
case BACKUP:
- sc->sc_if.if_link_state = LINK_STATE_DOWN;
+ link_state = LINK_STATE_DOWN;
break;
case MASTER:
- sc->sc_if.if_link_state = LINK_STATE_UP;
+ link_state = LINK_STATE_UP;
break;
default:
- sc->sc_if.if_link_state = LINK_STATE_UNKNOWN;
+ link_state = LINK_STATE_UNKNOWN;
break;
}
- rt_ifmsg(&sc->sc_if);
+ if_link_state_change(&sc->sc_if, link_state);
}
void
Home |
Main Index |
Thread Index |
Old Index