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:
Samuel Thibault 2025-03-30 16:50:12 +02:00
parent 7d2d97436c
commit b3b052a483

View file

@ -4029,6 +4029,23 @@ static void drop_routes(void)
LOG(1, 0, 0, "Disabling receiving l2tp\n"); LOG(1, 0, 0, "Disabling receiving l2tp\n");
// Disable receiving l2tp trafic first since we don't forward to master any more // Disable receiving l2tp trafic first since we don't forward to master any more
disableif(tunidx); 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"); LOG(1, 0, 0, "Dropping routes\n");
// Disable receiving Internet trafic // Disable receiving Internet trafic
for (i = 1; i <= config->cluster_highest_sessionid ; ++i) for (i = 1; i <= config->cluster_highest_sessionid ; ++i)