summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJafar Al-Gharaibeh <jafar@atcorp.com>2025-04-08 22:12:34 -0500
committerGitHub <noreply@github.com>2025-04-08 22:12:34 -0500
commit5d634fea73bc9c5be626a59b25b190f2b212b8ff (patch)
treec0b9d578ca4a9752571d91387965420c4071b9fc
parent297cf2232564f9bb8058b40509d4103cf0cd2838 (diff)
parent1e33841c5d4f4495a7b07599fa49c41135b2f9e1 (diff)
Merge pull request #18617 from FRRouting/mergify/bp/stable/10.2/pr-18583
babeld: check valid babel port (backport #18583)
-rw-r--r--babeld/babeld.c4
-rw-r--r--babeld/babeld.h2
2 files changed, 6 insertions, 0 deletions
diff --git a/babeld/babeld.c b/babeld/babeld.c
index b562f0b70c..c08cf72129 100644
--- a/babeld/babeld.c
+++ b/babeld/babeld.c
@@ -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;
diff --git a/babeld/babeld.h b/babeld/babeld.h
index 17a0381d2c..f4ee09a761 100644
--- a/babeld/babeld.h
+++ b/babeld/babeld.h
@@ -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))