From 24a64f5045b239fc19ea3b71a980b70dcad84e8e Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Sat, 3 Jun 2006 14:59:45 +0000 Subject: 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@ --- sbin/ifconfig/ifconfig.c | 5 +++-- 1 file 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)); -- cgit v1.2.3