summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2006-06-03 14:59:45 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2006-06-03 14:59:45 +0000
commit24a64f5045b239fc19ea3b71a980b70dcad84e8e (patch)
treea1de96bbc5a1679c94a859aca01811723fdf73e6 /sbin
parent97e3749a7f42d476731c9e98f4893a7efe3fc968 (diff)
Do not set newaddr to 1 if "delete" was specified beforhands. In this case
doalias is < 0. This fixes the problem where ifconfig em0 delete 10.0.0.1 created a 0.0.0.0/0 route entry and created a total mess because of that. Diff from markus@ OK beck@ markus@
Diffstat (limited to 'sbin')
-rw-r--r--sbin/ifconfig/ifconfig.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index 07b1a1ec675..f9b500495ee 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ifconfig.c,v 1.163 2006/06/02 19:53:12 mpf Exp $ */
+/* $OpenBSD: ifconfig.c,v 1.164 2006/06/03 14:59:44 claudio Exp $ */
/* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */
/*
@@ -951,7 +951,8 @@ setifaddr(const char *addr, int param)
* and the flags may change when the address is set.
*/
setaddr++;
- newaddr = 1;
+ if (doalias >= 0)
+ newaddr = 1;
if (doalias == 0)
clearaddr = 1;
(*afp->af_getaddr)(addr, (doalias >= 0 ? ADDR : RIDADDR));