]> git.puffer.fish Git - matthieu/frr.git/commitdiff
babeld: Add next hop initialization
authorzmw12306 <zmw12306@gmail.com>
Sun, 23 Mar 2025 23:02:14 +0000 (19:02 -0400)
committerzmw12306 <zmw12306@gmail.com>
Sun, 23 Mar 2025 23:02:14 +0000 (19:02 -0400)
Initialize v4_nh/v6_nh from source address at the beginning of packet parsing
Signed-off-by: zmw12306 <zmw12306@gmail.com>
babeld/message.c

index 5a33d5c288ac6d6885143720f338ca99ba2f3e71..8920bed164afcc7aabb7caa21a8ef64e65130a2c 100644 (file)
@@ -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;