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.
This commit is contained in:
Samuel Thibault 2024-10-19 19:54:37 +02:00
parent cc012e18fa
commit 011d9a726c

View file

@ -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))