From 011d9a726c0895d5a9edefb8628b9fed8a1d77e1 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 19 Oct 2024 19:54:37 +0200 Subject: [PATCH] Enable kernel acceleration for one-link mppp links Clients may have enabled mppp without actually using several links. We can support acceleration in that case. --- l2tpns.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/l2tpns.c b/l2tpns.c index 47c731b..cf2f00e 100644 --- a/l2tpns.c +++ b/l2tpns.c @@ -1143,7 +1143,7 @@ static int can_kernel_accel(sessionidt s) /* Disabled */ return 0; - if (session[s].bundle) + if (session[s].bundle != 0 && bundle[session[s].bundle].num_of_links > 1) /* MPPP not supported yet */ return 0; @@ -7659,7 +7659,12 @@ int sessionsetup(sessionidt s, tunnelidt t) } } - create_kernel_accel(s); + if (!session[s].bundle || (bundle[session[s].bundle].num_of_links == 1)) + /* Just one session, can accelerate */ + create_kernel_accel(s); + else if (session[s].bundle && bundle[session[s].bundle].num_of_links == 2) + /* Now several sessions, cannot accelerate the first session any more */ + delete_kernel_accel(bundle[session[s].bundle].members[0]); // no need to set a route for the same IP address of the bundle if (!session[s].bundle || (bundle[session[s].bundle].num_of_links == 1))