From a031da53db2f10349bb87f2824b16348fed914e9 Mon Sep 17 00:00:00 2001 From: zmw12306 Date: Sun, 23 Mar 2025 19:02:14 -0400 Subject: [PATCH] babeld: Add next hop initialization Initialize v4_nh/v6_nh from source address at the beginning of packet parsing Signed-off-by: zmw12306 --- babeld/message.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/babeld/message.c b/babeld/message.c index 5a33d5c288..8920bed164 100644 --- a/babeld/message.c +++ b/babeld/message.c @@ -441,6 +441,14 @@ parse_packet(const unsigned char *from, struct interface *ifp, return; } + if (v4mapped(from)) { + memcpy(v4_nh, from, 16); + have_v4_nh = 1; + } else { + memcpy(v6_nh, from, 16); + have_v6_nh = 1; + } + i = 0; while(i < bodylen) { message = packet + 4 + i; -- 2.39.5