projects
/
l2tpns.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fail IPCP negotiation only on ConfigRej of IP-Address
[l2tpns.git]
/
ppp.c
diff --git
a/ppp.c
b/ppp.c
index
d2708cd
..
d2c0cc4
100644
(file)
--- a/
ppp.c
+++ b/
ppp.c
@@
-1,6
+1,6
@@
// L2TPNS PPP Stuff
// L2TPNS PPP Stuff
-char const *cvs_id_ppp = "$Id: ppp.c,v 1.7
1 2005/08/11 06:22:11
bodea Exp $";
+char const *cvs_id_ppp = "$Id: ppp.c,v 1.7
4 2005/08/17 03:56:27
bodea Exp $";
#include <stdio.h>
#include <string.h>
#include <stdio.h>
#include <string.h>
@@
-85,8
+85,7
@@
void processpap(sessionidt s, tunnelidt t, uint8_t *p, uint16_t l)
LOG(3, s, t, "PAP login %s/%s\n", user, pass);
}
LOG(3, s, t, "PAP login %s/%s\n", user, pass);
}
- r = radiusnew(s);
- if (session[s].ip || !r)
+ if (session[s].ip || !(r = radiusnew(s)))
{
// respond now, either no RADIUS available or already authenticated
uint8_t b[MAXCONTROL];
{
// respond now, either no RADIUS available or already authenticated
uint8_t b[MAXCONTROL];
@@
-428,7
+427,7
@@
static uint8_t *ppp_nak(sessionidt s, uint8_t *buf, size_t blen, uint16_t mtype,
if (!queued)
return 0;
if (!queued)
return 0;
-
*nak_sent
++;
+
(*nak_sent)
++;
*queued = ConfigNak;
queued += 4;
}
*queued = ConfigNak;
queued += 4;
}
@@
-960,8
+959,9
@@
void processipcp(sessionidt s, tunnelidt t, uint8_t *p, uint16_t l)
addr = htonl(session[s].ip);
if (memcmp(o + 2, &addr, (sizeof addr)))
{
addr = htonl(session[s].ip);
if (memcmp(o + 2, &addr, (sizeof addr)))
{
+ uint8_t *oq = q;
q = ppp_nak(s, b, sizeof(b), PPPIPCP, &response, q, p, o, (uint8_t *) &addr, sizeof(addr));
q = ppp_nak(s, b, sizeof(b), PPPIPCP, &response, q, p, o, (uint8_t *) &addr, sizeof(addr));
- if (!q ||
*response == ConfigRej
)
+ if (!q ||
(q != oq && *response == ConfigRej)
)
{
sessionshutdown(s, "Can't negotiate IPCP.", 3, 0);
return;
{
sessionshutdown(s, "Can't negotiate IPCP.", 3, 0);
return;