Source-Changes-HG archive

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

[src/trunk]: src/sbin/ifconfig ifconfig: test cases want LINK_STATE_UNKNOWN t...



details:   https://anonhg.NetBSD.org/src/rev/4f656fbc8c9a
branches:  trunk
changeset: 944211:4f656fbc8c9a
user:      roy <roy%NetBSD.org@localhost>
date:      Wed Sep 23 10:48:12 2020 +0000

description:
ifconfig: test cases want LINK_STATE_UNKNOWN to be treated as up.

diffstat:

 sbin/ifconfig/ifconfig.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (32 lines):

diff -r 57cedbd26ae3 -r 4f656fbc8c9a sbin/ifconfig/ifconfig.c
--- a/sbin/ifconfig/ifconfig.c  Wed Sep 23 09:56:33 2020 +0000
+++ b/sbin/ifconfig/ifconfig.c  Wed Sep 23 10:48:12 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ifconfig.c,v 1.244 2020/09/23 02:09:18 roy Exp $       */
+/*     $NetBSD: ifconfig.c,v 1.245 2020/09/23 10:48:12 roy Exp $       */
 
 /*-
  * Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
 #ifndef lint
 __COPYRIGHT("@(#) Copyright (c) 1983, 1993\
  The Regents of the University of California.  All rights reserved.");
-__RCSID("$NetBSD: ifconfig.c,v 1.244 2020/09/23 02:09:18 roy Exp $");
+__RCSID("$NetBSD: ifconfig.c,v 1.245 2020/09/23 10:48:12 roy Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -1224,10 +1224,10 @@
 
                if (direct_ioctl(env, SIOCGIFDATA, &ifdr) == -1)
                        return EXIT_FAILURE;
-               if (ifdr.ifdr_data.ifi_link_state == LINK_STATE_UP)
+               if (ifdr.ifdr_data.ifi_link_state == LINK_STATE_DOWN)
+                       return EXIT_FAILURE;
+               else
                        return EXIT_SUCCESS;
-               else
-                       return EXIT_FAILURE;
        }
        if ((ifmr.ifm_status & IFM_AVALID) == 0) {
                /*



Home | Main Index | Thread Index | Old Index