Merge pull request #18583 from zmw12306/source_port

babeld: check valid babel port
This commit is contained in:
Jafar Al-Gharaibeh 2025-04-08 12:28:58 -05:00 committed by GitHub
commit 4281d2b2c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View 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;

View 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))