don't shutdown on TerminateReq, wait for CDN
This commit is contained in:
parent
1b6a7a95e6
commit
7462628249
4 changed files with 91 additions and 20 deletions
3
Changes
3
Changes
|
|
@ -1,3 +1,6 @@
|
||||||
|
* Tue Apr 18 2006 Brendan O'Dea <bod@optus.net> 2.1.18
|
||||||
|
- Don't shutdown on TerminateReq, wait for CDN.
|
||||||
|
|
||||||
* Thu Apr 13 2006 Brendan O'Dea <bod@optus.net> 2.1.17
|
* Thu Apr 13 2006 Brendan O'Dea <bod@optus.net> 2.1.17
|
||||||
- Fix IPCP length test to allow Terminate-Request (4 bytes).
|
- Fix IPCP length test to allow Terminate-Request (4 bytes).
|
||||||
- Send nsctl responses back using the correct source address (thanks ltd).
|
- Send nsctl responses back using the correct source address (thanks ltd).
|
||||||
|
|
|
||||||
15
l2tpns.h
15
l2tpns.h
|
|
@ -1,5 +1,5 @@
|
||||||
// L2TPNS Global Stuff
|
// L2TPNS Global Stuff
|
||||||
// $Id: l2tpns.h,v 1.112 2006-04-13 11:14:35 bodea Exp $
|
// $Id: l2tpns.h,v 1.113 2006-04-18 06:00:08 bodea Exp $
|
||||||
|
|
||||||
#ifndef __L2TPNS_H__
|
#ifndef __L2TPNS_H__
|
||||||
#define __L2TPNS_H__
|
#define __L2TPNS_H__
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <libcli.h>
|
#include <libcli.h>
|
||||||
|
|
||||||
#define VERSION "2.1.17"
|
#define VERSION "2.1.18"
|
||||||
|
|
||||||
// Limits
|
// Limits
|
||||||
#define MAXTUNNEL 500 // could be up to 65535
|
#define MAXTUNNEL 500 // could be up to 65535
|
||||||
|
|
@ -147,7 +147,16 @@ enum {
|
||||||
|
|
||||||
// reset state machine counters
|
// reset state machine counters
|
||||||
#define initialise_restart_count(_s, _fsm) \
|
#define initialise_restart_count(_s, _fsm) \
|
||||||
sess_local[_s]._fsm.conf_sent = sess_local[_s]._fsm.nak_sent = 0
|
sess_local[_s]._fsm.conf_sent = \
|
||||||
|
sess_local[_s]._fsm.nak_sent = 0
|
||||||
|
|
||||||
|
// no more attempts
|
||||||
|
#define zero_restart_count(_s, _fsm) ({ \
|
||||||
|
sess_local[_s]._fsm.conf_sent = \
|
||||||
|
config->ppp_max_configure; \
|
||||||
|
sess_local[_s]._fsm.restart = \
|
||||||
|
time_now + config->ppp_restart_time; \
|
||||||
|
})
|
||||||
|
|
||||||
// increment ConfReq counter and reset timer
|
// increment ConfReq counter and reset timer
|
||||||
#define restart_timer(_s, _fsm) ({ \
|
#define restart_timer(_s, _fsm) ({ \
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
Summary: A high-speed clustered L2TP LNS
|
Summary: A high-speed clustered L2TP LNS
|
||||||
Name: l2tpns
|
Name: l2tpns
|
||||||
Version: 2.1.17
|
Version: 2.1.18
|
||||||
Release: 1
|
Release: 1
|
||||||
License: GPL
|
License: GPL
|
||||||
Group: System Environment/Daemons
|
Group: System Environment/Daemons
|
||||||
|
|
@ -43,5 +43,5 @@ rm -rf %{buildroot}
|
||||||
%attr(644,root,root) /usr/share/man/man[58]/*
|
%attr(644,root,root) /usr/share/man/man[58]/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Thu Apr 13 2006 Brendan O'Dea <bod@optus.net> 2.1.17-1
|
* Tue Apr 18 2006 Brendan O'Dea <bod@optus.net> 2.1.18-1
|
||||||
- 2.1.17 release, see /usr/share/doc/l2tpns-2.1.17/Changes
|
- 2.1.18 release, see /usr/share/doc/l2tpns-2.1.18/Changes
|
||||||
|
|
|
||||||
85
ppp.c
85
ppp.c
|
|
@ -1,6 +1,6 @@
|
||||||
// L2TPNS PPP Stuff
|
// L2TPNS PPP Stuff
|
||||||
|
|
||||||
char const *cvs_id_ppp = "$Id: ppp.c,v 1.98 2006-04-13 11:14:35 bodea Exp $";
|
char const *cvs_id_ppp = "$Id: ppp.c,v 1.99 2006-04-18 06:00:08 bodea Exp $";
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
@ -870,7 +870,29 @@ void processlcp(sessionidt s, tunnelidt t, uint8_t *p, uint16_t l)
|
||||||
}
|
}
|
||||||
else if (*p == TerminateReq)
|
else if (*p == TerminateReq)
|
||||||
{
|
{
|
||||||
*p = TerminateAck; // close
|
switch (session[s].ppp.lcp)
|
||||||
|
{
|
||||||
|
case Closed:
|
||||||
|
case Stopped:
|
||||||
|
case Closing:
|
||||||
|
case Stopping:
|
||||||
|
case RequestSent:
|
||||||
|
case AckReceived:
|
||||||
|
case AckSent:
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Opened:
|
||||||
|
lcp_restart(s);
|
||||||
|
zero_restart_count(s, lcp);
|
||||||
|
change_state(s, lcp, Closing);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
LOG(2, s, t, "LCP: ignoring %s in state %s\n", ppp_code(*p), ppp_state(session[s].ppp.lcp));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
*p = TerminateAck; // send ack
|
||||||
q = makeppp(b, sizeof(b), p, l, s, t, PPPLCP);
|
q = makeppp(b, sizeof(b), p, l, s, t, PPPLCP);
|
||||||
if (!q) return;
|
if (!q) return;
|
||||||
|
|
||||||
|
|
@ -878,11 +900,6 @@ void processlcp(sessionidt s, tunnelidt t, uint8_t *p, uint16_t l)
|
||||||
if (config->debug > 3) dumplcp(q, l);
|
if (config->debug > 3) dumplcp(q, l);
|
||||||
|
|
||||||
tunnelsend(b, l + (q - b), t); // send it
|
tunnelsend(b, l + (q - b), t); // send it
|
||||||
sessionshutdown(s, "Remote end closed connection.", CDN_ADMIN_DISC, TERM_USER_REQUEST);
|
|
||||||
}
|
|
||||||
else if (*p == TerminateAck)
|
|
||||||
{
|
|
||||||
sessionshutdown(s, "Connection closed.", CDN_ADMIN_DISC, TERM_NAS_REQUEST);
|
|
||||||
}
|
}
|
||||||
else if (*p == ProtocolRej)
|
else if (*p == ProtocolRej)
|
||||||
{
|
{
|
||||||
|
|
@ -1153,12 +1170,33 @@ void processipcp(sessionidt s, tunnelidt t, uint8_t *p, uint16_t l)
|
||||||
}
|
}
|
||||||
else if (*p == TerminateReq)
|
else if (*p == TerminateReq)
|
||||||
{
|
{
|
||||||
*p = TerminateAck;
|
switch (session[s].ppp.ipcp)
|
||||||
|
{
|
||||||
|
case Closed:
|
||||||
|
case Stopped:
|
||||||
|
case Closing:
|
||||||
|
case Stopping:
|
||||||
|
case RequestSent:
|
||||||
|
case AckReceived:
|
||||||
|
case AckSent:
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Opened:
|
||||||
|
zero_restart_count(s, ipcp);
|
||||||
|
change_state(s, ipcp, Closing);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
LOG(2, s, t, "IPCP: ignoring %s in state %s\n", ppp_code(*p), ppp_state(session[s].ppp.ipcp));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
*p = TerminateAck; // send ack
|
||||||
q = makeppp(b, sizeof(b), p, l, s, t, PPPIPCP);
|
q = makeppp(b, sizeof(b), p, l, s, t, PPPIPCP);
|
||||||
if (!q) return;
|
if (!q) return;
|
||||||
|
|
||||||
LOG(3, s, t, "IPCP: send %s\n", ppp_code(*q));
|
LOG(3, s, t, "IPCP: send %s\n", ppp_code(*q));
|
||||||
tunnelsend(b, l + (q - b), t);
|
tunnelsend(b, l + (q - b), t); // send it
|
||||||
change_state(s, ipcp, Stopped);
|
|
||||||
}
|
}
|
||||||
else if (*p != CodeRej)
|
else if (*p != CodeRej)
|
||||||
{
|
{
|
||||||
|
|
@ -1353,12 +1391,33 @@ void processipv6cp(sessionidt s, tunnelidt t, uint8_t *p, uint16_t l)
|
||||||
}
|
}
|
||||||
else if (*p == TerminateReq)
|
else if (*p == TerminateReq)
|
||||||
{
|
{
|
||||||
*p = TerminateAck;
|
switch (session[s].ppp.ipv6cp)
|
||||||
|
{
|
||||||
|
case Closed:
|
||||||
|
case Stopped:
|
||||||
|
case Closing:
|
||||||
|
case Stopping:
|
||||||
|
case RequestSent:
|
||||||
|
case AckReceived:
|
||||||
|
case AckSent:
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Opened:
|
||||||
|
zero_restart_count(s, ipv6cp);
|
||||||
|
change_state(s, ipv6cp, Closing);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
LOG(2, s, t, "IPV6CP: ignoring %s in state %s\n", ppp_code(*p), ppp_state(session[s].ppp.ipv6cp));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
*p = TerminateAck; // send ack
|
||||||
q = makeppp(b, sizeof(b), p, l, s, t, PPPIPV6CP);
|
q = makeppp(b, sizeof(b), p, l, s, t, PPPIPV6CP);
|
||||||
if (!q) return;
|
if (!q) return;
|
||||||
|
|
||||||
LOG(3, s, t, "IPV6CP: send %s\n", ppp_code(*q));
|
LOG(3, s, t, "IPV6CP: send %s\n", ppp_code(*q));
|
||||||
tunnelsend(b, l + (q - b), t);
|
tunnelsend(b, l + (q - b), t); // send it
|
||||||
change_state(s, ipv6cp, Stopped);
|
|
||||||
}
|
}
|
||||||
else if (*p != CodeRej)
|
else if (*p != CodeRej)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue