Source-Changes-HG archive

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

[src/trunk]: src/sbin/ifconfig Revert to previous as the atf tests are still ...



details:   https://anonhg.NetBSD.org/src/rev/ad4cc467dd05
branches:  trunk
changeset: 369449:ad4cc467dd05
user:      nat <nat%NetBSD.org@localhost>
date:      Wed Aug 17 23:36:48 2022 +0000

description:
Revert to previous as the atf tests are still failing.

diffstat:

 sbin/ifconfig/af_inetany.c |  20 ++++----------------
 1 files changed, 4 insertions(+), 16 deletions(-)

diffs (48 lines):

diff -r b3acec713685 -r ad4cc467dd05 sbin/ifconfig/af_inetany.c
--- a/sbin/ifconfig/af_inetany.c        Wed Aug 17 22:27:17 2022 +0000
+++ b/sbin/ifconfig/af_inetany.c        Wed Aug 17 23:36:48 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: af_inetany.c,v 1.22 2022/08/17 12:35:10 nat Exp $      */
+/*     $NetBSD: af_inetany.c,v 1.23 2022/08/17 23:36:48 nat 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.22 2022/08/17 12:35:10 nat Exp $");
+__RCSID("$NetBSD: af_inetany.c,v 1.23 2022/08/17 23:36:48 nat Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -68,7 +68,6 @@
     const struct afparam *param)
 {
        const char *ifname;
-       struct ifreq ifr;
        int af, rc, s;
        bool alias, delete, replace;
        prop_data_t d;
@@ -89,19 +88,8 @@
 
        if ((d = (prop_data_t)prop_dictionary_get(env, "address")) != NULL)
                addr = prop_data_value(d);
-       else if (param->gifaddr.cmd == 0)
-               return;
-       else if (!prop_dictionary_get_bool(env, "alias", &alias)) { 
-               static struct paddr_prefix existingaddr;
-
-               memset(&ifr, 0, sizeof(ifr));
-               estrlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
-               if (prog_ioctl(s, SIOCGIFADDR, &ifr) == -1)
-                       return;
-
-               existingaddr.pfx_addr = ifr.ifr_addr;
-               addr = &existingaddr;
-       } else if (alias)
+       else if (!prop_dictionary_get_bool(env, "alias", &alias) || alias ||
+           param->gifaddr.cmd == 0)
                return;
        else if (prog_ioctl(s, param->gifaddr.cmd, param->dgreq.buf) == -1)
                err(EXIT_FAILURE, "%s", param->gifaddr.desc);



Home | Main Index | Thread Index | Old Index