summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/lcp.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1997-06-01 03:43:26 +0000
committerbrian <brian@FreeBSD.org>1997-06-01 03:43:26 +0000
commite39002afc27c9ffda52400838c668a0af8e9982c (patch)
treeef1d02091667d6794da32fccb39ee68afa6d5265 /usr.sbin/ppp/lcp.c
parent0e779533082753004e1e3529858c07205320d59e (diff)
downloadFreeBSD-src-e39002afc27c9ffda52400838c668a0af8e9982c.zip
FreeBSD-src-e39002afc27c9ffda52400838c668a0af8e9982c.tar.gz
Remove initial startup printf's in -direct mode.
Make "same magic" error send a NAK (as per rfc).
Diffstat (limited to 'usr.sbin/ppp/lcp.c')
-rw-r--r--usr.sbin/ppp/lcp.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/usr.sbin/ppp/lcp.c b/usr.sbin/ppp/lcp.c
index 2a63d00..8134329 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;
OpenPOWER on IntegriCloud