diff options
author | brian <brian@FreeBSD.org> | 1997-08-19 01:10:24 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1997-08-19 01:10:24 +0000 |
commit | f4cc1c34030b6b39140566167f95d436ae620cf8 (patch) | |
tree | f4aec5bd5512e3c3e7b029d26903acef851e30ac /usr.sbin/ppp/ipcp.c | |
parent | 03ba12afe1091b81f6f14967da3302842700df2a (diff) | |
download | FreeBSD-src-f4cc1c34030b6b39140566167f95d436ae620cf8.zip FreeBSD-src-f4cc1c34030b6b39140566167f95d436ae620cf8.tar.gz |
Correct the forth arg to "set ifaddr". If specified,
it gives the IP number that should be used for initial
IPCP config requests, irrespective of MYADDR.
Diffstat (limited to 'usr.sbin/ppp/ipcp.c')
-rw-r--r-- | usr.sbin/ppp/ipcp.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/usr.sbin/ppp/ipcp.c b/usr.sbin/ppp/ipcp.c index ae5e405..90c6f36 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.22 1997/06/25 19:30:00 brian Exp $ + * $Id: ipcp.c,v 1.23 1997/07/29 22:37:04 brian Exp $ * * TODO: * o More RFC1772 backwoard compatibility @@ -42,7 +42,9 @@ extern void Prompt(); extern struct in_addr ifnetmask; struct ipcpstate IpcpInfo; -struct in_range DefMyAddress, DefHisAddress, DefTriggerAddress; +struct in_range DefMyAddress, DefHisAddress; +struct in_addr TriggerAddress; +int HaveTriggerAddress; #ifndef NOMSEXT struct in_addr ns_entries[2], nbns_entries[2]; @@ -137,8 +139,10 @@ ReportIpcpStatus() inet_ntoa(DefMyAddress.ipaddr), DefMyAddress.width); fprintf(VarTerm, " His Address: %s/%d\n", inet_ntoa(DefHisAddress.ipaddr), DefHisAddress.width); - fprintf(VarTerm, " Negotiation: %s/%d\n", - inet_ntoa(DefTriggerAddress.ipaddr), DefTriggerAddress.width); + if (HaveTriggerAddress) + fprintf(VarTerm, " Negotiation(trigger): %s\n", inet_ntoa(TriggerAddress)); + else + fprintf(VarTerm, " Negotiation(trigger): MYADDR\n"); return 0; } @@ -151,7 +155,8 @@ IpcpDefAddress() bzero(&DefMyAddress, sizeof(DefMyAddress)); bzero(&DefHisAddress, sizeof(DefHisAddress)); - bzero(&DefTriggerAddress, sizeof(DefTriggerAddress)); + TriggerAddress.s_addr = 0; + HaveTriggerAddress = 0; if (gethostname(name, sizeof(name)) == 0) { hp = gethostbyname(name); if (hp && hp->h_addrtype == AF_INET) { @@ -180,8 +185,9 @@ IpcpInit() * 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 (HaveTriggerAddress) { + icp->want_ipaddr.s_addr = TriggerAddress.s_addr; + LogPrintf(LogLCP, "Using trigger address %s\n", inet_ntoa(TriggerAddress)); } if (Enabled(ConfVjcomp)) |