l2tp: Add PAP auth information in ICCN

To support proxy auth.
This commit is contained in:
Samuel Thibault 2025-03-23 03:17:41 +01:00
parent e701644d37
commit 40796d2adb
4 changed files with 37 additions and 0 deletions

View file

@ -4862,6 +4862,9 @@ void processudp(uint8_t *buf, int len, struct sockaddr_in *addr, uint16_t indexu
session[s].ppp.lcp = Starting;
sess_local[s].lcp_last_received_confreq_n = 0;
sess_local[s].lcp_last_sent_confreq_n = 0;
sess_local[s].auth_type = 0;
sess_local[s].auth_name[0] = 0;
sess_local[s].auth_resp[0] = 0;
STAT(session_created);
break;
@ -4912,6 +4915,20 @@ void processudp(uint8_t *buf, int len, struct sockaddr_in *addr, uint16_t indexu
controlb(c, 28, sess_local[fs].lcp_last_received_confreq,
sess_local[fs].lcp_last_received_confreq_n, 0);
if (sess_local[fs].auth_type == 3) // PAP
{
// Proxy Authentication Type
control16(c, 29, sess_local[fs].auth_type, 0);
// Proxy Authentication Name
controlb(c, 30, sess_local[fs].auth_name,
strlen((const char*) sess_local[fs].auth_name), 0);
// Proxy Authentication Id
control16(c, 32, sess_local[fs].auth_id, 0);
// Proxy Authentication Response
controlb(c, 33, sess_local[fs].auth_resp,
strlen((const char*) sess_local[fs].auth_resp), 0);
}
controladd(c, asession, t); // send the message
LOG(3, s, t, "Sending ICCN\n");
}