summaryrefslogtreecommitdiff
path: root/sbin/ifconfig/ifconfig.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2009-11-22 18:45:20 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2009-11-22 18:45:20 +0000
commit7daed0107f497e4b4ff65b1a8f1f6cb2d7bde47c (patch)
tree2308d0fe6e8d57f5edc02d8ac0ea29504811a270 /sbin/ifconfig/ifconfig.c
parent832a4e0700eb0aaa6224480c77007423742a2654 (diff)
Fix ifconfig -a vs. ifconfig -A and make ifconfig without any arg behave
like ifconfig -a by setting the aflag to 1. Found with and OK deraadt@
Diffstat (limited to 'sbin/ifconfig/ifconfig.c')
-rw-r--r--sbin/ifconfig/ifconfig.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index 7f1fc8a809b..79dffb5f8e8 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ifconfig.c,v 1.221 2009/11/21 14:09:41 claudio Exp $ */
+/* $OpenBSD: ifconfig.c,v 1.222 2009/11/22 18:45:19 claudio Exp $ */
/* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */
/*
@@ -515,7 +515,8 @@ main(int argc, char *argv[])
/* If no args at all, print all interfaces. */
if (argc < 2) {
- printif(NULL, ifaliases);
+ aflag = 1;
+ printif(NULL, 0);
exit(0);
}
argc--, argv++;
@@ -660,7 +661,7 @@ nextarg:
}
if (argc == 0 && actions == 0 && !noprint) {
- printif(ifr.ifr_name, 1);
+ printif(ifr.ifr_name, aflag ? ifaliases : 1);
exit(0);
}