l2tp: Add Last Sent/Received LCP ConfReq in ICCN
To support proxy LCP negotiation.
This commit is contained in:
parent
ffcaf851ca
commit
6f04a5c390
3 changed files with 54 additions and 0 deletions
14
l2tpns.c
14
l2tpns.c
|
|
@ -4841,6 +4841,8 @@ void processudp(uint8_t *buf, int len, struct sockaddr_in *addr, uint16_t indexu
|
|||
|
||||
session[s].ppp.phase = Establish;
|
||||
session[s].ppp.lcp = Starting;
|
||||
sess_local[s].lcp_last_received_confreq_n = 0;
|
||||
sess_local[s].lcp_last_sent_confreq_n = 0;
|
||||
|
||||
STAT(session_created);
|
||||
break;
|
||||
|
|
@ -4867,6 +4869,7 @@ void processudp(uint8_t *buf, int len, struct sockaddr_in *addr, uint16_t indexu
|
|||
LOG(3, s, t, "Received ICRP\n");
|
||||
if (session[s].forwardtosession)
|
||||
{
|
||||
sessionidt fs = session[s].forwardtosession;
|
||||
controlt *c = controlnew(12); // ICCN
|
||||
|
||||
session[s].opened = time_now;
|
||||
|
|
@ -4879,6 +4882,17 @@ void processudp(uint8_t *buf, int len, struct sockaddr_in *addr, uint16_t indexu
|
|||
|
||||
control32(c, 19, 1, 1); // Framing Type
|
||||
control32(c, 24, 10000000, 1); // Tx Connect Speed
|
||||
|
||||
if (sess_local[fs].lcp_last_sent_confreq_n)
|
||||
// Last Sent LCP ConfReq
|
||||
controlb(c, 27, sess_local[fs].lcp_last_sent_confreq,
|
||||
sess_local[fs].lcp_last_sent_confreq_n, 0);
|
||||
|
||||
if (sess_local[fs].lcp_last_received_confreq_n)
|
||||
// Last Received LCP ConfReq
|
||||
controlb(c, 28, sess_local[fs].lcp_last_received_confreq,
|
||||
sess_local[fs].lcp_last_received_confreq_n, 0);
|
||||
|
||||
controladd(c, asession, t); // send the message
|
||||
LOG(3, s, t, "Sending ICCN\n");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue