summaryrefslogtreecommitdiff
path: root/sbin/ifconfig/ifconfig.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/ifconfig/ifconfig.c')
-rw-r--r--sbin/ifconfig/ifconfig.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index 2b399ce924d..468fa41b521 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ifconfig.c,v 1.150 2005/10/03 01:35:12 reyk Exp $ */
+/* $OpenBSD: ifconfig.c,v 1.151 2005/10/10 10:28:19 henning Exp $ */
/* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */
/*
@@ -708,9 +708,6 @@ printif(char *ifname, int ifaliases)
struct ifreq *ifrp;
int nlen = 0, count = 0, noinet = 1;
- if (getifaddrs(&ifap) != 0)
- err(1, "getifaddrs");
-
if (ifname) {
if ((oname = strdup(ifname)) == NULL)
err(1, "strdup");
@@ -720,6 +717,9 @@ printif(char *ifname, int ifaliases)
return;
}
+ if (getifaddrs(&ifap) != 0)
+ err(1, "getifaddrs");
+
namep = NULL;
for (ifa = ifap; ifa; ifa = ifa->ifa_next) {
if (oname) {