summaryrefslogtreecommitdiff
path: root/sbin/ifconfig
diff options
context:
space:
mode:
authorPeter Hessler <phessler@cvs.openbsd.org>2019-01-17 04:28:22 +0000
committerPeter Hessler <phessler@cvs.openbsd.org>2019-01-17 04:28:22 +0000
commit0a26c8ae1d26b626eb81a355453c851c9e6eedc9 (patch)
treefa94e39d574fa5524bd2c7de87c44ee5de5a293f /sbin/ifconfig
parent6d3b253b668e9632fb1f8abcf25ff837249e1a0f (diff)
do not allow users to specify "join" or "nwid" twice on the same ifconfig call
Diffstat (limited to 'sbin/ifconfig')
-rw-r--r--sbin/ifconfig/ifconfig.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index e540fd33e67..7a19550c4e4 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ifconfig.c,v 1.387 2018/11/29 00:12:34 dlg Exp $ */
+/* $OpenBSD: ifconfig.c,v 1.388 2019/01/17 04:28:21 phessler Exp $ */
/* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */
/*
@@ -1719,6 +1719,10 @@ setifnwid(const char *val, int d)
errx(1, "nwid and join may not be used at the same time");
}
+ if (strlen(nwidname) != 0) {
+ errx(1, "nwid may not be specified twice");
+ }
+
if (d != 0) {
/* no network id is especially desired */
memset(&nwid, 0, sizeof(nwid));
@@ -1759,6 +1763,10 @@ setifjoin(const char *val, int d)
errx(1, "nwid and join may not be used at the same time");
}
+ if (strlen(joinname) != 0) {
+ errx(1, "join may not be specified twice");
+ }
+
if (d != 0) {
/* no network id is especially desired */
memset(&join, 0, sizeof(join));