summaryrefslogtreecommitdiff
path: root/sbin/ifconfig
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2006-06-01 18:54:20 +0000
committerBob Beck <beck@cvs.openbsd.org>2006-06-01 18:54:20 +0000
commit3c4b6903a74b76dc090c657b89a5534d5237db49 (patch)
tree3c6bddbc0bbb6b3e1e09ee5e5d28b2bb13846232 /sbin/ifconfig
parent37c7e3af83377548f282dbcccf1cd4bb4dad716a (diff)
ifconfig should be either deleting an interface address, or adding one in one
invocation, not both. This change ensures that a delete does not also do an add. Fixes stupid problem where deleting the last address with ifconfig delete addr worked differently than ifconfig addr delete where the first way would re-add an address of 0.0.0.0/0 after deleting the address. ok claudio@, krw@
Diffstat (limited to 'sbin/ifconfig')
-rw-r--r--sbin/ifconfig/ifconfig.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index 634af6f08a7..d150e768a7e 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ifconfig.c,v 1.160 2006/05/17 03:29:55 reyk Exp $ */
+/* $OpenBSD: ifconfig.c,v 1.161 2006/06/01 18:54:19 beck Exp $ */
/* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */
/*
@@ -629,7 +629,7 @@ main(int argc, char *argv[])
err(1, "SIOCDIFADDR");
}
}
- if (newaddr) {
+ else if (newaddr) {
(void) strlcpy(rafp->af_addreq, name, sizeof(ifr.ifr_name));
if (ioctl(s, rafp->af_aifaddr, rafp->af_addreq) < 0)
err(1, "SIOCAIFADDR");