Make it possible to indicate that we don't care about the remote

sides IP address, as long as it isn't 0.0.0.0
This commit is contained in:
Poul-Henning Kamp 1998-02-28 21:01:09 +00:00
parent df37b71c14
commit c544ff8a5e
2 changed files with 15 additions and 4 deletions

View File

@ -23,7 +23,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" $Id: sppp.4,v 1.2 1997/09/29 10:10:21 wosch Exp $
.\" $Id: sppp.4,v 1.3 1997/10/11 11:27:25 joerg Exp $
.\"
.Dd May 19, 1997
.Dt SPPP 4
@ -119,6 +119,14 @@ way the IPCP option negotiation works, this address is being supplied
late during the negotiation, which might cause the remote peer to make
wrong assumptions.
.Pp
In a similar spirit the remote address can be set to the magical
value 0.0.0.1 which means that we don't care what address the remote
side will use, as long as it is not 0.0.0.0.
This is useful if your ISP has several dial-in
servers. You can of course
.Ic route add something or other 0.0.0.1
and it will do exactly what you would want it to.
.Pp
The PAP and CHAP authentication protocols as described in RFC 1334,
and RFC 1994 resp., are also implemented. Their parameters are being
controlled by the

View File

@ -17,7 +17,7 @@
*
* From: Version 2.4, Thu Apr 30 17:17:21 MSD 1997
*
* $Id: if_spppsubr.c,v 1.31 1998/01/08 23:41:31 eivind Exp $
* $Id: if_spppsubr.c,v 1.32 1998/02/09 06:09:57 eivind Exp $
*/
#include "opt_inet.h"
@ -2502,15 +2502,18 @@ sppp_ipcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
case IPCP_OPT_ADDRESS:
desiredaddr = p[2] << 24 | p[3] << 16 |
p[4] << 8 | p[5];
if (desiredaddr == hisaddr) {
if (desiredaddr == hisaddr ||
(hisaddr == 1 && desiredaddr != 0) {
/*
* Peer's address is same as our value,
* or we have set it to 0.0.0.1 to
* indicate that we do not really care,
* this is agreeable. Gonna conf-ack
* it.
*/
if (debug)
addlog("%s [ack] ",
sppp_dotted_quad(hisaddr));
sppp_dotted_quad(desiredaddr));
/* record that we've seen it already */
sp->ipcp.flags |= IPCP_HISADDR_SEEN;
continue;