summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2025-04-08 10:54:50 -0400
committerGitHub <noreply@github.com>2025-04-08 10:54:50 -0400
commit9f59a2d05cbee28634245a889b64ff9ae3c4df93 (patch)
treea9873e9a22c25f5682b9787474c8cdc0607a891a
parent53a8868331e662a0785a0cbcdd452b4f1017d534 (diff)
parente43dbc8fe10290e4337a8732f7ef897a83483b36 (diff)
Merge pull request #18584 from zmw12306/babel_get_myid
babeld: Add a check to prevent all-ones case
-rw-r--r--babeld/babeld.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/babeld/babeld.c b/babeld/babeld.c
index 4e68f05df4..c776df0d2b 100644
--- a/babeld/babeld.c
+++ b/babeld/babeld.c
@@ -212,7 +212,8 @@ static void babel_init_routing_process(struct event *thread)
babel_main_loop(thread);/* this function self-add to the t_update thread */
}
-/* fill "myid" with an unique id (only if myid != {0}). */
+/* fill "myid" with an unique id (only if myid != {0} and myid != {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}). */
static void
babel_get_myid(void)
{
@@ -222,7 +223,7 @@ babel_get_myid(void)
int i;
/* if we already have an id (from state file), we return. */
- if (memcmp(myid, zeroes, 8) != 0) {
+ if (memcmp(myid, zeroes, 8) != 0 && memcmp(myid, ones, 8) != 0) {
return;
}