summaryrefslogtreecommitdiff
path: root/proto
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2023-01-30 23:49:20 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2023-01-30 23:49:20 +0100
commit96d7c4679df49b34be004177b10a99210af5f141 (patch)
tree6ddb2830b418768db3ec92a1c7255164cd761a9a /proto
parent3e7e4a71868bc519aacc0eb785471b46fc345a5c (diff)
Babel: Improve clarity of unfeasible update handling.
Add a comment and (unnecessary) check to make correctness obvious.
Diffstat (limited to 'proto')
-rw-r--r--proto/babel/babel.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/proto/babel/babel.c b/proto/babel/babel.c
index a20bd724..25081c3b 100644
--- a/proto/babel/babel.c
+++ b/proto/babel/babel.c
@@ -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);