summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrian <brian@cvs.openbsd.org>1997-12-19 18:12:09 +0000
committerbrian <brian@cvs.openbsd.org>1997-12-19 18:12:09 +0000
commitde97fb04553d802d2562475ce04c6bdc904c25db (patch)
tree4df64c710a0eca51c3aee86dc0dcbbe7e77586d9
parent00938515f58ac95a3c63c3cc9f65ba03076f1c11 (diff)
Reset our "ifaddr" to zero if the "set ifaddr" fails in
-auto mode. This makes ppp correctly exit if you kick it off twice in auto mode with the same label (read: interface).
-rw-r--r--usr.sbin/ppp/command.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c
index 8866badb18d..e5ee56d617c 100644
--- a/usr.sbin/ppp/command.c
+++ b/usr.sbin/ppp/command.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: command.c,v 1.9 1997/12/18 01:10:25 brian Exp $
+ * $Id: command.c,v 1.10 1997/12/19 18:12:08 brian Exp $
*
*/
#include <sys/param.h>
@@ -1260,8 +1260,10 @@ SetInterfaceAddr(struct cmdargs const *arg)
IpcpInfo.his_ipaddr.s_addr = DefHisAddress.ipaddr.s_addr;
if ((mode & MODE_AUTO) &&
- OsSetIpaddress(DefMyAddress.ipaddr, DefHisAddress.ipaddr) < 0)
+ OsSetIpaddress(DefMyAddress.ipaddr, DefHisAddress.ipaddr) < 0) {
+ DefMyAddress.ipaddr.s_addr = DefHisAddress.ipaddr.s_addr = 0L;
return 4;
+ }
}
return 0;