Module Name: src
Committed By: riz
Date: Fri Feb 8 22:41:29 UTC 2013
Modified Files:
src/sbin/ifconfig [netbsd-6]: af_inetany.c
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.6.1 src/sbin/ifconfig/af_inetany.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sbin/ifconfig/af_inetany.c
diff -u src/sbin/ifconfig/af_inetany.c:1.14 src/sbin/ifconfig/af_inetany.c:1.14.6.1
--- src/sbin/ifconfig/af_inetany.c:1.14 Tue May 24 11:38:56 2011
+++ src/sbin/ifconfig/af_inetany.c Fri Feb 8 22:41:29 2013
@@ -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 @@ commit_address(prop_dictionary_t env, pr
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 @@ commit_address(prop_dictionary_t env, pr
/* 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)