]> git.puffer.fish Git - matthieu/frr.git/commitdiff
babeld: fix #11808 to avoid infinite loops
authorharryreps <harryreps@gmail.com>
Fri, 3 Mar 2023 23:17:14 +0000 (23:17 +0000)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Sun, 5 May 2024 16:31:50 +0000 (16:31 +0000)
Replacing continue in loops to goto done so that index of packet buffer
increases.

Signed-off-by: harryreps <harryreps@gmail.com>
(cherry picked from commit ae1e0e1fed77716bc06f181ad68c4433fb5523d0)

babeld/message.c

index 7d45d91bf7a50f73171fc8fea8061e1890585739..2bf23379657eb90768e7491570658b666a680ae9 100644 (file)
@@ -439,7 +439,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
                        debugf(BABEL_DEBUG_COMMON,
                               "Received Hello from %s on %s that does not have all 0's in the unused section of flags, ignoring",
                               format_address(from), ifp->name);
-                       continue;
+                       goto done;
                }
 
                /*
@@ -451,7 +451,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
                        debugf(BABEL_DEBUG_COMMON,
                               "Received Unicast Hello from %s on %s that FRR is not prepared to understand yet",
                               format_address(from), ifp->name);
-                       continue;
+                       goto done;
                }
 
                DO_NTOHS(seqno, message + 4);
@@ -469,7 +469,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
                        debugf(BABEL_DEBUG_COMMON,
                               "Received hello from %s on %s should be ignored as that this version of FRR does not know how to properly handle interval == 0",
                               format_address(from), ifp->name);
-                       continue;
+                       goto done;
                }
 
                changed = update_neighbour(neigh, seqno, interval);