Add route for session-specific subprefix of the ipv6 prefix
Otherwise with kernel acceleration we would only have the same /64 route on all ppp devices. We need separate /96 routes on each ppp device for packets of the /96 subprefix to be routed to the correct session.
This commit is contained in:
parent
8c04e26f3f
commit
e53fccd36c
1 changed files with 9 additions and 0 deletions
9
l2tpns.c
9
l2tpns.c
|
|
@ -1247,6 +1247,15 @@ void routes6set(sessionidt s, sessiont *sp, int add)
|
|||
if (!add || sessionbyipv6(sp->ipv6address) != s)
|
||||
route6set(s, sp->ipv6address, 128, add);
|
||||
}
|
||||
else
|
||||
{
|
||||
in_addr_t addr_ipv4 = htonl(session[s].ip);
|
||||
struct in6_addr addr;
|
||||
memset(&addr, 0, sizeof(addr));
|
||||
memcpy(&addr, &config->ipv6_prefix, 8);
|
||||
memcpy(&addr.s6_addr[8], &addr_ipv4, 4);
|
||||
route6set(s, addr, 96, add);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue