cluster: Close l2tp sockets before routes
So another l2tpns on the same host can receive l2tp while we are quickly removing our routes.
This commit is contained in:
parent
7d2d97436c
commit
b3b052a483
1 changed files with 17 additions and 0 deletions
17
l2tpns.c
17
l2tpns.c
|
|
@ -4029,6 +4029,23 @@ static void drop_routes(void)
|
|||
LOG(1, 0, 0, "Disabling receiving l2tp\n");
|
||||
// Disable receiving l2tp trafic first since we don't forward to master any more
|
||||
disableif(tunidx);
|
||||
|
||||
LOG(1, 0, 0, "Closing l2tp sockets\n");
|
||||
// Close l2tp sockets to let potential slave on the same host get it
|
||||
for (i = 0; i < config->nbudpfd; i++)
|
||||
{
|
||||
close(udpfd[i]);
|
||||
udpfd[i] = -1;
|
||||
}
|
||||
for (i = 1; i <= config->cluster_highest_tunnelid; i++)
|
||||
{
|
||||
if (tunn_local[i].l2tp_fd >= 0)
|
||||
{
|
||||
close(tunn_local[i].l2tp_fd);
|
||||
tunn_local[i].l2tp_fd = -1;
|
||||
}
|
||||
}
|
||||
|
||||
LOG(1, 0, 0, "Dropping routes\n");
|
||||
// Disable receiving Internet trafic
|
||||
for (i = 1; i <= config->cluster_highest_sessionid ; ++i)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue