Source-Changes-HG archive

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

[src/trunk]: src/sbin/ifconfig ifconfig: if SIOCGLIFADDR fails, continue to t...



details:   https://anonhg.NetBSD.org/src/rev/87f129432b19
branches:  trunk
changeset: 944803:87f129432b19
user:      roy <roy%NetBSD.org@localhost>
date:      Sun Oct 11 21:32:37 2020 +0000

description:
ifconfig: if SIOCGLIFADDR fails, continue to the next address

diffstat:

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

diffs (30 lines):

diff -r d5a63a1f8cc7 -r 87f129432b19 sbin/ifconfig/util.c
--- a/sbin/ifconfig/util.c      Sun Oct 11 19:39:22 2020 +0000
+++ b/sbin/ifconfig/util.c      Sun Oct 11 21:32:37 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: util.c,v 1.19 2019/10/01 10:52:53 kardel Exp $ */
+/*     $NetBSD: util.c,v 1.20 2020/10/11 21:32:37 roy Exp $    */
 
 /*-
  * Copyright (c) 2008 David Young.  All rights reserved.
@@ -27,7 +27,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: util.c,v 1.19 2019/10/01 10:52:53 kardel Exp $");
+__RCSID("$NetBSD: util.c,v 1.20 2020/10/11 21:32:37 roy Exp $");
 #endif /* not lint */
 
 #include <ctype.h>
@@ -275,8 +275,10 @@
                iflr.flags = IFLR_PREFIX;
                iflr.prefixlen = sdl->sdl_alen * NBBY;
 
-               if (prog_ioctl(s, SIOCGLIFADDR, &iflr) == -1)
+               if (prog_ioctl(s, SIOCGLIFADDR, &iflr) == -1) {
                        warn("%s: ioctl SIOCGLIFADDR", __func__);
+                       continue;
+               }
 
                if (((iflr.flags & IFLR_ACTIVE) != 0) != print_active_only)
                        continue;



Home | Main Index | Thread Index | Old Index