Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/ifwatchd Simplify logic - invoke script when addres...



details:   https://anonhg.NetBSD.org/src/rev/b129715c6f5d
branches:  trunk
changeset: 818300:b129715c6f5d
user:      roy <roy%NetBSD.org@localhost>
date:      Thu Oct 06 10:33:05 2016 +0000

description:
Simplify logic - invoke script when address is added and ready or
when removed.

diffstat:

 usr.sbin/ifwatchd/ifwatchd.c |  13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)

diffs (28 lines):

diff -r a478c1b09e9f -r b129715c6f5d usr.sbin/ifwatchd/ifwatchd.c
--- a/usr.sbin/ifwatchd/ifwatchd.c      Thu Oct 06 10:30:31 2016 +0000
+++ b/usr.sbin/ifwatchd/ifwatchd.c      Thu Oct 06 10:33:05 2016 +0000
@@ -1,6 +1,6 @@
-/*     $NetBSD: ifwatchd.c,v 1.37 2016/10/06 10:30:31 roy Exp $        */
+/*     $NetBSD: ifwatchd.c,v 1.38 2016/10/06 10:33:05 roy Exp $        */
 #include <sys/cdefs.h>
- __RCSID("$NetBSD: ifwatchd.c,v 1.37 2016/10/06 10:30:31 roy Exp $");
+__RCSID("$NetBSD: ifwatchd.c,v 1.38 2016/10/06 10:33:05 roy Exp $");
 
 /*-
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -338,14 +338,7 @@
        if (ifa != NULL && ifd != NULL) {
                ev = ifam->ifam_type == RTM_DELADDR ? DOWN : UP;
                aflag = check_addrflags(ifa->sa_family, ifam->ifam_addrflags);
-               if (ev == UP) {
-                       if (aflag == NOTREADY)
-                               return;
-                       if (aflag == DETACHED)
-                               return;         /* XXX set ev to DOWN? */
-               }
-               if ((ev == UP && aflag == READY) ||
-                   (ev == DOWN && aflag == DETACHED /* XXX why DETACHED? */))
+               if ((ev == UP && aflag == READY) || ev == DOWN)
                        invoke_script(ifd->ifname, ev, ifa, brd);
        }
 }



Home | Main Index | Thread Index | Old Index