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/3c95ba2f3016
branches:  trunk
changeset: 823875:3c95ba2f3016
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 bac8ba504c58 -r 3c95ba2f3016 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