From 2b13f59f6a2db5ccacc4205a379c2cb53cc47e16 Mon Sep 17 00:00:00 2001 From: Tassilo Schweyer Date: Mon, 5 May 2025 00:52:28 +0200 Subject: [PATCH] Only send in hacky case --- l2tpns.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/l2tpns.c b/l2tpns.c index 317c6e9..f5ccff9 100644 --- a/l2tpns.c +++ b/l2tpns.c @@ -5074,15 +5074,7 @@ void processudp(uint8_t *buf, int len, struct sockaddr_in *addr, uint16_t indexu LOG(3, s, t, "Reusing LCP negotiation\n"); // Start with proxy auth id to avoid client caching challenge responses sess_local[s].auth_id = authid; - if (authchalln <= 16) { - memcpy(sess_local[s].auth_chall, authchall, authchalln); - } - if (authrespn <= 64) { - memcpy(sess_local[s].auth_resp, authresp, authrespn); - } - if (atype != 0) { - sess_local[s].auth_type = atype; - } + strncpy(sess_local[s].auth_name, authname, sizeof(sess_local[s].auth_name) - 1); if (strstr(authname, "umts")) { if (last_sent_lcp_confreq_n) { @@ -5093,6 +5085,15 @@ void processudp(uint8_t *buf, int len, struct sockaddr_in *addr, uint16_t indexu sess_local[s].lcp_last_received_confreq_n = last_received_lcp_confreq_n; memcpy(sess_local[s].lcp_last_received_confreq, last_received_lcp_confreq, last_sent_lcp_confreq_n); } + if (authchalln <= 16) { + memcpy(sess_local[s].auth_chall, authchall, authchalln); + } + if (authrespn <= 64) { + memcpy(sess_local[s].auth_resp, authresp, authrespn); + } + if (atype != 0) { + sess_local[s].auth_type = atype; + } } if (!sess_local[s].lcp_authtype)