From 72fca9b8f0dac6c6a2d25bd78031f7a2684164fc Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Mon, 21 Aug 2023 20:29:15 +0900 Subject: [PATCH] create/update_kernel_tunnel: add some debug logs --- l2tpns.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/l2tpns.c b/l2tpns.c index 572443f..34afaf7 100644 --- a/l2tpns.c +++ b/l2tpns.c @@ -640,7 +640,7 @@ static int create_kernel_tunnel(uint32_t tid, uint32_t peer_tid) /* Already set up */ return 0; - LOG(3, 0, tid, "Creating kernel tunnel from %u to %u\n", tid, peer_tid); + LOG(2, 0, tid, "Creating kernel tunnel from %u to %u\n", tid, peer_tid); memset(&req, 0, sizeof(req)); @@ -704,8 +704,10 @@ static int create_kernel_tunnel(uint32_t tid, uint32_t peer_tid) // Update remote address of kernel tunnel static int update_kernel_tunnel(sessionidt s, tunnelidt t) { - if (tunn_local[t].l2tp_fd < 0) + if (tunn_local[t].l2tp_fd < 0) { + LOG(2, s, t, "IP change was requested for tunnel before it is connected\n"); return -1; + } struct sockaddr_in tunneladdr; memset(&tunneladdr, 0, sizeof(tunneladdr));