diff --git a/l2tpns.c b/l2tpns.c index 77b3333..e64210c 100644 --- a/l2tpns.c +++ b/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)