Don't delete the primary interface address when

``iface clean'' is used in auto mode while there
are no active links.
This commit is contained in:
brian 1998-11-05 21:59:48 +00:00
parent 4b3ca37c67
commit 8b481ceb01
3 changed files with 20 additions and 11 deletions

View File

@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Id: command.c,v 1.174 1998/10/27 22:53:22 brian Exp $ * $Id: command.c,v 1.175 1998/10/31 17:38:46 brian Exp $
* *
*/ */
#include <sys/types.h> #include <sys/types.h>
@ -134,7 +134,7 @@
#define NEG_DNS 50 #define NEG_DNS 50
const char Version[] = "2.0"; const char Version[] = "2.0";
const char VersionDate[] = "$Date: 1998/10/27 22:53:22 $"; const char VersionDate[] = "$Date: 1998/10/31 17:38:46 $";
static int ShowCommand(struct cmdargs const *); static int ShowCommand(struct cmdargs const *);
static int TerminalCommand(struct cmdargs const *); static int TerminalCommand(struct cmdargs const *);
@ -2417,7 +2417,8 @@ IfaceClearCommand(struct cmdargs const *arg)
if (arg->argc != arg->argn) if (arg->argc != arg->argn)
return -1; return -1;
how = arg->bundle->ncp.ipcp.fsm.state == ST_OPENED ? how = arg->bundle->ncp.ipcp.fsm.state == ST_OPENED ||
arg->bundle->phys_type.all & PHYS_AUTO ?
IFACE_CLEAR_ALIASES : IFACE_CLEAR_ALL; IFACE_CLEAR_ALIASES : IFACE_CLEAR_ALL;
iface_Clear(arg->bundle->iface, how); iface_Clear(arg->bundle->iface, how);

View File

@ -1,4 +1,4 @@
.\" $Id: ppp.8,v 1.132 1998/10/27 22:53:22 brian Exp $ .\" $Id: ppp.8,v 1.133 1998/10/31 17:38:47 brian Exp $
.Dd 20 September 1995 .Dd 20 September 1995
.Os FreeBSD .Os FreeBSD
.Dt PPP 8 .Dt PPP 8
@ -2528,10 +2528,14 @@ allows.
.It iface clear .It iface clear
If this command is used while If this command is used while
.Nm .Nm
is in the OPENED state, all addresses except for the IPCP negotiated is in the OPENED state or while in
address are deleted from the interface. If .Fl auto
mode, all addresses except for the IPCP negotiated address are deleted
from the interface. If
.Nm .Nm
is not in the OPENED state, all interface addresses are deleted. is not in the OPENED state and is not in
.Fl auto
mode, all interface addresses are deleted.
.Pp .Pp
.It iface delete[!]|rm[!] Ar addr .It iface delete[!]|rm[!] Ar addr
This command deletes the given This command deletes the given

View File

@ -1,4 +1,4 @@
.\" $Id: ppp.8,v 1.132 1998/10/27 22:53:22 brian Exp $ .\" $Id: ppp.8,v 1.133 1998/10/31 17:38:47 brian Exp $
.Dd 20 September 1995 .Dd 20 September 1995
.Os FreeBSD .Os FreeBSD
.Dt PPP 8 .Dt PPP 8
@ -2528,10 +2528,14 @@ allows.
.It iface clear .It iface clear
If this command is used while If this command is used while
.Nm .Nm
is in the OPENED state, all addresses except for the IPCP negotiated is in the OPENED state or while in
address are deleted from the interface. If .Fl auto
mode, all addresses except for the IPCP negotiated address are deleted
from the interface. If
.Nm .Nm
is not in the OPENED state, all interface addresses are deleted. is not in the OPENED state and is not in
.Fl auto
mode, all interface addresses are deleted.
.Pp .Pp
.It iface delete[!]|rm[!] Ar addr .It iface delete[!]|rm[!] Ar addr
This command deletes the given This command deletes the given