aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/ppp/ipcp.c
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>1998-05-15 23:58:30 +0000
committerBrian Somers <brian@FreeBSD.org>1998-05-15 23:58:30 +0000
commitdd0645c5b76252f6c673406039f384ba2cdeea74 (patch)
tree684801d060a212758ea54068162a61bfd1d7c05b /usr.sbin/ppp/ipcp.c
parentea7229694b5a94840ef14aa0bb71bb338f02bbe9 (diff)
downloadsrc-dd0645c5b76252f6c673406039f384ba2cdeea74.tar.gz
src-dd0645c5b76252f6c673406039f384ba2cdeea74.zip
o Add the `set mode' command for change a links current mode. It
is not possible to switch to or from dedicated or direct mode, but all other combinations are ok (eg. -auto -> -ddial). o Cope with the fact that commands with optional context may not be able to obtain a link with command_ChooseLink() (if all links have been deleted for example). o Allow `clone'ing in non-multilink mode. We may for example want to configure two links in unilink mode and dial them both, using the one that comes up first. It's also possible to rename ``deflink'' by cloning it, deleting the original, then setting the mode of the new link.
Notes
Notes: svn path=/cvs2svn/branches/MP/; revision=36088
Diffstat (limited to 'usr.sbin/ppp/ipcp.c')
-rw-r--r--usr.sbin/ppp/ipcp.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/usr.sbin/ppp/ipcp.c b/usr.sbin/ppp/ipcp.c
index 4b3982a832fe..dd3c1680b43b 100644
--- a/usr.sbin/ppp/ipcp.c
+++ b/usr.sbin/ppp/ipcp.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: ipcp.c,v 1.50.2.50 1998/05/05 23:30:03 brian Exp $
+ * $Id: ipcp.c,v 1.50.2.51 1998/05/06 23:50:14 brian Exp $
*
* TODO:
* o More RFC1772 backwoard compatibility
@@ -691,6 +691,22 @@ IpcpLayerDown(struct fsm *fp)
ipcp_CleanInterface(ipcp);
}
+int
+ipcp_InterfaceUp(struct ipcp *ipcp)
+{
+ if (ipcp_SetIPaddress(ipcp->fsm.bundle, ipcp->my_ip, ipcp->peer_ip, 0) < 0) {
+ log_Printf(LogERROR, "IpcpLayerUp: unable to set ip address\n");
+ return 0;
+ }
+
+#ifndef NOALIAS
+ if (alias_IsEnabled())
+ (*PacketAlias.SetAddress)(ipcp->my_ip);
+#endif
+
+ return 1;
+}
+
static int
IpcpLayerUp(struct fsm *fp)
{
@@ -705,15 +721,8 @@ IpcpLayerUp(struct fsm *fp)
if (ipcp->peer_compproto >> 16 == PROTO_VJCOMP)
sl_compress_init(&ipcp->vj.cslc, (ipcp->peer_compproto >> 8) & 255);
- if (ipcp_SetIPaddress(fp->bundle, ipcp->my_ip, ipcp->peer_ip, 0) < 0) {
- log_Printf(LogERROR, "IpcpLayerUp: unable to set ip address\n");
+ if (!ipcp_InterfaceUp(ipcp))
return 0;
- }
-
-#ifndef NOALIAS
- if (alias_IsEnabled())
- (*PacketAlias.SetAddress)(ipcp->my_ip);
-#endif
/*
* XXX this stuff should really live in the FSM. Our config should