Add ICMPv6 support with acceleration
This commit is contained in:
parent
5dcbd68b75
commit
58d038dc0b
4 changed files with 120 additions and 2 deletions
16
l2tpns.c
16
l2tpns.c
|
|
@ -1229,6 +1229,7 @@ static int create_kernel_accel(sessionidt s)
|
|||
sess_local[s].ppp_if_idx = ifr.ifr_ifindex;
|
||||
|
||||
dhcpv6_listen(ifr.ifr_ifindex);
|
||||
icmpv6_listen(ifr.ifr_ifindex);
|
||||
|
||||
memset(&sess_local[s].last_stats, 0, sizeof(sess_local[s].last_stats));
|
||||
|
||||
|
|
@ -5449,8 +5450,8 @@ static int still_busy(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
// the base set of fds polled: cli, cluster, tun, udp (MAX_UDPFD), control, dae, netlink, udplac, pppoedisc, pppoesess, dhcpv6
|
||||
#define BASE_FDS (10 + MAX_UDPFD)
|
||||
// the base set of fds polled: cli, cluster, tun, udp (MAX_UDPFD), control, dae, netlink, udplac, pppoedisc, pppoesess, dhcpv6, icmpv6
|
||||
#define BASE_FDS (11 + MAX_UDPFD)
|
||||
|
||||
// additional polled fds
|
||||
#ifdef BGP
|
||||
|
|
@ -5537,6 +5538,10 @@ static void mainloop(void)
|
|||
e.data.ptr = &d[i++];
|
||||
epoll_ctl(epollfd, EPOLL_CTL_ADD, dhcpv6fd, &e);
|
||||
|
||||
d[i].type = FD_TYPE_ICMPV6;
|
||||
e.data.ptr = &d[i++];
|
||||
epoll_ctl(epollfd, EPOLL_CTL_ADD, icmpv6fd, &e);
|
||||
|
||||
for (j = 0; j < config->nbudpfd; j++)
|
||||
{
|
||||
d[i].type = FD_TYPE_UDP;
|
||||
|
|
@ -5802,6 +5807,12 @@ static void mainloop(void)
|
|||
break;
|
||||
}
|
||||
|
||||
case FD_TYPE_ICMPV6:
|
||||
{
|
||||
icmpv6_process_from_kernel(p, size_bufp);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
LOG(0, 0, 0, "Unexpected fd type returned from epoll_wait: %d\n", d->type);
|
||||
}
|
||||
|
|
@ -6774,6 +6785,7 @@ int main(int argc, char *argv[])
|
|||
initrad();
|
||||
initippool();
|
||||
dhcpv6_init();
|
||||
icmpv6_init();
|
||||
|
||||
// seed prng
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue