Some implementation of PPP are required that starting a negotiaion by

sending *special* value as my address, even though the standard of PPP
is defined full negotiation based.  (e.g. "0.0.0.0" or Not "0.0.0.0")
This commit is contained in:
Atsushi Murai 1995-07-08 08:28:10 +00:00
parent 215a46965b
commit 549d663d78
3 changed files with 28 additions and 6 deletions

View File

@ -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.5 1995/05/30 03:50:30 rgrimes Exp $
* $Id: command.c,v 1.6 1995/06/16 07:07:56 phk Exp $
*
*/
#include <ctype.h>
@ -629,6 +629,12 @@ char **argv;
&DefHisAddress.ipaddr, &DefHisAddress.mask, &DefHisAddress.width);
if (--argc > 0) {
ifnetmask = GetIpAddr(*argv);
if (--argc > 0) {
ParseAddr(argc, argv++,
&DefTriggerAddress.ipaddr,
&DefTriggerAddress.mask,
&DefTriggerAddress.width);
}
}
}
}

View File

@ -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.4 1995/05/30 03:50:38 rgrimes Exp $
* $Id: ipcp.c,v 1.5 1995/07/04 02:57:11 davidg Exp $
*
* TODO:
* o More RFC1772 backwoard compatibility
@ -41,7 +41,7 @@ extern void Prompt();
extern struct in_addr ifnetmask;
struct ipcpstate IpcpInfo;
struct in_range DefMyAddress, DefHisAddress;
struct in_range DefMyAddress, DefHisAddress, DefTriggerAddress;
static void IpcpSendConfigReq __P((struct fsm *));
static void IpcpSendTerminateAck __P((struct fsm *));
@ -125,10 +125,13 @@ ReportIpcpStatus()
printf(" my side: %s, %x\n",
inet_ntoa(icp->want_ipaddr), icp->want_compproto);
printf("connected: %d secs, idle: %d secs\n\n", ipConnectSecs, ipIdleSecs);
printf("Defaults: My Address: %s/%d ",
printf("Defaults:\n");
printf(" My Address: %s/%d\n",
inet_ntoa(DefMyAddress.ipaddr), DefMyAddress.width);
printf("His Address: %s/%d\n",
printf(" His Address: %s/%d\n",
inet_ntoa(DefHisAddress.ipaddr), DefHisAddress.width);
printf(" Negotiation: %s/%d\n",
inet_ntoa(DefTriggerAddress.ipaddr), DefTriggerAddress.width);
}
void
@ -139,6 +142,7 @@ IpcpDefAddress()
bzero(&DefMyAddress, sizeof(DefMyAddress));
bzero(&DefHisAddress, sizeof(DefHisAddress));
bzero(&DefTriggerAddress, sizeof(DefTriggerAddress));
if (gethostname(name, sizeof(name)) == 0) {
hp = gethostbyname(name);
if (hp && hp->h_addrtype == AF_INET) {
@ -160,6 +164,17 @@ IpcpInit()
icp->want_ipaddr.s_addr = DefMyAddress.ipaddr.s_addr;
icp->his_ipaddr.s_addr = DefHisAddress.ipaddr.s_addr;
}
/*
* Some implementation of PPP are:
* Starting a negotiaion by require sending *special* value as my address,
* even though standard of PPP is defined full negotiation based.
* (e.g. "0.0.0.0" or Not "0.0.0.0")
*/
if ( icp->want_ipaddr.s_addr == 0 ) {
icp->want_ipaddr.s_addr = DefTriggerAddress.ipaddr.s_addr;
}
if (Enabled(ConfVjcomp))
icp->want_compproto = (PROTO_VJCOMP << 16) | ((MAX_STATES - 1) << 8);
else

View File

@ -15,7 +15,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id:$
* $Id: ipcp.h,v 1.2 1995/02/26 12:17:34 amurai Exp $
*
* TODO:
*/
@ -56,6 +56,7 @@ struct in_range {
extern struct ipcpstate IpcpInfo;
extern struct in_range DefMyAddress;
extern struct in_range DefHisAddress;
extern struct in_range DefTriggerAddress;
extern void IpcpInit __P((void));
extern void IpcpDefAddress __P((void));