summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2006-07-24 08:02:44 +0000
committerDamien Miller <djm@cvs.openbsd.org>2006-07-24 08:02:44 +0000
commit3c1b5d0d99ec992fdcb5243cd845b810c0a95b51 (patch)
tree17ec499fb12978cb51b48dbdb4075acbda70af61
parent8988f520d4e3d70fc72e574d2b27e34a1265b35d (diff)
make "brconfig" with no arguments equivalent to "brconfig -a",
following the similar change to ifconfig; 'nice' deraadt@
-rw-r--r--sbin/brconfig/brconfig.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sbin/brconfig/brconfig.c b/sbin/brconfig/brconfig.c
index 10c1d3e64f7..bb8213b433a 100644
--- a/sbin/brconfig/brconfig.c
+++ b/sbin/brconfig/brconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: brconfig.c,v 1.35 2006/03/20 20:01:34 dhill Exp $ */
+/* $OpenBSD: brconfig.c,v 1.36 2006/07/24 08:02:43 djm Exp $ */
/*
* Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net)
@@ -109,21 +109,21 @@ main(int argc, char *argv[])
int error = 0, sock;
char *brdg;
- if (argc < 2) {
- usage();
- return (EX_USAGE);
- }
-
sock = socket(AF_INET, SOCK_DGRAM, 0);
if (sock < 0)
err(1, "socket");
+ if (argc < 2 || strcmp(argv[1], "-a") == 0)
+ return bridge_show_all(sock);
+
+ if (strcmp(argv[1], "-h") == 0) {
+ usage();
+ return (EX_USAGE);
+ }
+
argc--; argv++;
brdg = argv[0];
- if (strcmp(brdg, "-a") == 0)
- return bridge_show_all(sock);
-
if (strlen(brdg) >= IFNAMSIZ) {
warnx("%s is not a bridge", brdg);
return (EX_USAGE);