]> git.puffer.fish Git - mirror/frr.git/commitdiff
babeld: check valid babel port 18617/head
authorzmw12306 <zmw12306@gmail.com>
Sat, 5 Apr 2025 19:14:12 +0000 (15:14 -0400)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Tue, 8 Apr 2025 17:30:24 +0000 (17:30 +0000)
Add checking for port == 6696.

Signed-off-by: zmw12306 <zmw12306@gmail.com>
(cherry picked from commit 6f88868f325f0269198fb8e0c00b40a7bbe0e53f)

babeld/babeld.c
babeld/babeld.h

index b562f0b70c39b074bfe63880c69fb29f5ed5538d..c08cf72129c9fb8e8698cb1f04bbab3bbdfd890f 100644 (file)
@@ -183,6 +183,10 @@ static void babel_read_protocol(struct event *thread)
             flog_err_sys(EC_LIB_SOCKET, "recv: %s", safe_strerror(errno));
         }
     } else {
+        if(ntohs(sin6.sin6_port) != BABEL_PORT) {
+            return;
+        }
+
         FOR_ALL_INTERFACES(vrf, ifp) {
             if(!if_up(ifp))
                 continue;
index 17a0381d2c5021c9c1c59e971a6a174604624825..f4ee09a761fd1031680a43ee0b964ae461f21727 100644 (file)
@@ -21,6 +21,8 @@ Copyright 2011 by Matthieu Boutier and Juliusz Chroboczek
 #undef MAX
 #undef MIN
 
+#define BABEL_PORT 6696
+
 #define MAX(x,y) ((x)<=(y)?(y):(x))
 #define MIN(x,y) ((x)<=(y)?(x):(y))