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 atf tests were failing.
details: https://anonhg.NetBSD.org/src/rev/5de2c24d017b
branches: trunk
changeset: 369430:5de2c24d017b
user: nat <nat%NetBSD.org@localhost>
date: Tue Aug 16 22:31:24 2022 +0000
description:
Revert to previous as atf tests were failing.
diffstat:
sbin/ifconfig/af_inetany.c | 26 ++++----------------------
1 files changed, 4 insertions(+), 22 deletions(-)
diffs (60 lines):
diff -r 7e3489a294b3 -r 5de2c24d017b sbin/ifconfig/af_inetany.c
--- a/sbin/ifconfig/af_inetany.c Tue Aug 16 21:23:37 2022 +0000
+++ b/sbin/ifconfig/af_inetany.c Tue Aug 16 22:31:24 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: af_inetany.c,v 1.20 2022/08/16 10:47:10 nat Exp $ */
+/* $NetBSD: af_inetany.c,v 1.21 2022/08/16 22:31:24 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.20 2022/08/16 10:47:10 nat Exp $");
+__RCSID("$NetBSD: af_inetany.c,v 1.21 2022/08/16 22:31:24 nat Exp $");
#endif /* not lint */
#include <sys/param.h>
@@ -68,15 +68,12 @@
const struct afparam *param)
{
const char *ifname;
- struct ifreq ifr;
int af, rc, s;
bool alias, delete, replace;
prop_data_t d;
const struct paddr_prefix *addr, *brd, *dst, *mask;
unsigned short flags;
- addr = NULL;
-
if ((af = getaf(env)) == -1)
af = AF_INET;
@@ -92,23 +89,8 @@
if ((d = (prop_data_t)prop_dictionary_get(env, "address")) != NULL)
addr = prop_data_value(d);
else if (!prop_dictionary_get_bool(env, "alias", &alias) || alias ||
- param->gifaddr.cmd == 0) {
- if (addr == NULL) {
- 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) {
- if (errno == EADDRNOTAVAIL ||
- errno == EAFNOSUPPORT)
- return;
- err(EXIT_FAILURE,"SIOCGIFADDR");
- }
-
- existingaddr.pfx_addr = ifr.ifr_addr;
- addr = &existingaddr;
- }
- }
+ param->gifaddr.cmd == 0)
+ return;
else if (prog_ioctl(s, param->gifaddr.cmd, param->dgreq.buf) == -1)
err(EXIT_FAILURE, "%s", param->gifaddr.desc);
else if (prog_ioctl(s, param->difaddr.cmd, param->dgreq.buf) == -1)
Home |
Main Index |
Thread Index |
Old Index