]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Babel: Improve clarity of unfeasible update handling.
authorOndrej Zajicek <santiago@crfreenet.org>
Mon, 30 Jan 2023 22:49:20 +0000 (23:49 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Mon, 30 Jan 2023 22:49:20 +0000 (23:49 +0100)
Add a comment and (unnecessary) check to make correctness obvious.

proto/babel/babel.c

index a20bd72456bb82bc3b4055de156da0b24f3d1ca0..25081c3bde2f24073bc35e71d4a8406d7e1af86d 100644 (file)
@@ -1308,9 +1308,10 @@ babel_handle_update(union babel_msg *m, struct babel_iface *ifa)
 
   /*
    * RFC section 3.8.2.2 - Dealing with unfeasible updates. Generate a one-off
-   * (not retransmitted) unicast seqno request to the originator of this update
+   * (not retransmitted) unicast seqno request to the originator of this update.
+   * Note: !feasible -> s exists, check for 's' is just for clarity / safety.
    */
-  if (!feasible && (metric != BABEL_INFINITY) &&
+  if (!feasible && s && (metric != BABEL_INFINITY) &&
       (!best || (r == best) || (metric < best->metric)))
     babel_generate_seqno_request(p, e, s->router_id, s->seqno + 1, nbr);