Source-Changes-HG archive

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

[src/netbsd-6]: src/sbin/ifconfig Pull up following revision(s) (requested by...



details:   https://anonhg.NetBSD.org/src/rev/0c784e3c0418
branches:  netbsd-6
changeset: 775654:0c784e3c0418
user:      riz <riz%NetBSD.org@localhost>
date:      Fri Feb 08 22:41:29 2013 +0000

description:
Pull up following revision(s) (requested by christos in ticket #799):
        sbin/ifconfig/af_inetany.c: revision 1.16
PR/46579: Takahiro HAYASHI: ifconfig clone destroy should not print useless
diagnostic and exit with an error code. Get the interface name and flags
opportunistically to allow the code to return normally if it does not need
to do anything.

diffstat:

 sbin/ifconfig/af_inetany.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (37 lines):

diff -r a22b3a64e1f0 -r 0c784e3c0418 sbin/ifconfig/af_inetany.c
--- a/sbin/ifconfig/af_inetany.c        Fri Feb 08 22:34:10 2013 +0000
+++ b/sbin/ifconfig/af_inetany.c        Fri Feb 08 22:41:29 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: af_inetany.c,v 1.14 2011/05/24 11:38:56 joerg Exp $    */
+/*     $NetBSD: af_inetany.c,v 1.14.6.1 2013/02/08 22:41:29 riz Exp $  */
 
 /*-
  * Copyright (c) 2008 David Young.  All rights reserved.
@@ -27,7 +27,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: af_inetany.c,v 1.14 2011/05/24 11:38:56 joerg Exp $");
+__RCSID("$NetBSD: af_inetany.c,v 1.14.6.1 2013/02/08 22:41:29 riz Exp $");
 #endif /* not lint */
 
 #include <sys/param.h> 
@@ -80,7 +80,7 @@
        if ((s = getsock(af)) == -1)
                err(EXIT_FAILURE, "%s: getsock", __func__);
 
-       if ((ifname = getifinfo(env, oenv, &flags)) == NULL)
+       if ((ifname = getifname(env)) == NULL)
                return;
 
        strlcpy(param->name[0].buf, ifname, param->name[0].buflen);
@@ -126,6 +126,9 @@
        /* TBD: read matching ifaddr from kernel, use the netmask as default
         * TBD: handle preference
         */
+       if (getifflags(env, oenv, &flags) == -1)
+               err(EXIT_FAILURE, "%s: getifflags", __func__);
+
        switch (flags & (IFF_BROADCAST|IFF_POINTOPOINT)) {
        case IFF_BROADCAST:
                if (brd != NULL)



Home | Main Index | Thread Index | Old Index