diff options
author | Brian Somers <brian@FreeBSD.org> | 1997-06-01 03:43:26 +0000 |
---|---|---|
committer | Brian Somers <brian@FreeBSD.org> | 1997-06-01 03:43:26 +0000 |
commit | 1f3dee4c22d9287aabda29ae4e515a30beb397fa (patch) | |
tree | bf575b91043bf2f509164c49bcfdcb54dfbec65b /usr.sbin/ppp/lcp.c | |
parent | da2b73b1eeac8bbf8274559b909060e8f2a19b68 (diff) | |
download | src-1f3dee4c22d9287aabda29ae4e515a30beb397fa.tar.gz src-1f3dee4c22d9287aabda29ae4e515a30beb397fa.zip |
Notes
Diffstat (limited to 'usr.sbin/ppp/lcp.c')
-rw-r--r-- | usr.sbin/ppp/lcp.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/usr.sbin/ppp/lcp.c b/usr.sbin/ppp/lcp.c index 2a63d00db985..81343290a220 100644 --- a/usr.sbin/ppp/lcp.c +++ b/usr.sbin/ppp/lcp.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: lcp.c,v 1.20 1997/05/24 17:32:38 brian Exp $ + * $Id: lcp.c,v 1.21 1997/05/26 00:44:03 brian Exp $ * * TODO: * o Validate magic number received from peer. @@ -574,12 +574,16 @@ int mode; switch (mode) { case MODE_REQ: if (LcpInfo.want_magic) { - /* XXX: Shoud validate magic number */ - if (magic == LcpInfo.want_magic) - logprintf("magic is same!! %x, %x, %x\n", - magic, LcpInfo.want_magic, LcpInfo.his_magic); - LcpInfo.his_magic = magic; - bcopy(cp, ackp, length); ackp += length; + /* Validate magic number */ + if (magic == LcpInfo.want_magic) { + LogPrintf(LOG_LCP_BIT, "Magic is same (%08x)\n", magic); + LcpInfo.want_magic = GenerateMagic(); + bcopy(cp, nakp, 6); + nakp += 6; + } else { + LcpInfo.his_magic = magic; + bcopy(cp, ackp, length); ackp += length; + } } else { LcpInfo.my_reject |= (1 << type); goto reqreject; |