aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/bfd
diff options
context:
space:
mode:
authorAlexander Chernavin <achernavin@netgate.com>2023-11-23 11:36:09 +0000
committerDave Wallace <dwallacelf@gmail.com>2023-12-01 19:29:55 +0000
commitf9c322be7da6a23c467526f5323a3fcdcc9aad86 (patch)
tree963a73bdecd6ae3544c6274db89ac426b7400ec6 /src/vnet/bfd
parentb75bde18c44420021ae9800b584b1c644fed2a87 (diff)
bfd: fix buffer leak when cannot send periodic packets
When a periodic BFD packet cannot be sent because the interface is disabled, the allocated buffer needs to be freed. This currently will occur for IPv4 sessions. However, buffers will leak for IPv6 sessions as in this case, bfd_transport_control_frame() and bfd_transport_udp6() will not indicate failure. With this fix, stop always returning success in bfd_transport_udp6() and start returning the actual return value. Type: fix Change-Id: I5fa4d9206e32cccae3053ef24966d80e2022fc81 Signed-off-by: Alexander Chernavin <achernavin@netgate.com> (cherry picked from commit 1f4023d55d7a9c777465d24065e91fc076602fb0)
Diffstat (limited to 'src/vnet/bfd')
-rw-r--r--src/vnet/bfd/bfd_udp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vnet/bfd/bfd_udp.c b/src/vnet/bfd/bfd_udp.c
index 2ba43a309d1..bf403dfe866 100644
--- a/src/vnet/bfd/bfd_udp.c
+++ b/src/vnet/bfd/bfd_udp.c
@@ -483,7 +483,7 @@ bfd_transport_udp6 (vlib_main_t *vm, vlib_node_runtime_t *rt, u32 bi,
is_echo ? &bm->tx_echo_counter :
&bm->tx_counter);
}
- return 1;
+ return rv;
}
static bfd_session_t *