-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Summary
The function update_feasible() in the Babel routing implementation accepts updates as feasible even when the source is NULL or the source’s data is stale. This behavior violates Babel’s feasibility condition as specified in RFC 8966 §2.4 (Feasibility Condition)
Babel uses a slightly more refined feasibility condition, derived from EIGRP [DUAL]. Given a router A, define the feasibility distance of A, written FD(A), as the smallest metric that A has ever advertised for S to any of its neighbours. An update sent by a neighbour B of A is feasible when the metric D(B) advertised by B is strictly smaller than A's feasibility distance, i.e., when D(B) < FD(A).
Affected Code
Function: update_feasible()
if(src == NULL)
return 1;
if(src->time < now.tv_sec - SOURCE_GC_TIME)
/* Never mind what is probably stale data */
return 1;
if(refmetric >= INFINITY)
return 1;
return (seqno_compare(seqno, src->seqno) > 0 ||
(src->seqno == seqno && refmetric < src->metric));If src == NULL, there is no known prior state. The Feasibility Condition cannot be verified, yet the route is accepted as feasible.
If src->time is stale (older than SOURCE_GC_TIME), the previous state is too old to be trusted, yet the route is again accepted.
Also, (seqno_compare(seqno, src->seqno) > 0 || (src->seqno == seqno && refmetric < src->metric)) is not implementing the babel feasibility condition mentioned above.
Suggest:
if(src == NULL)
return 0; // Cannot evaluate feasibility
if(src->time < now.tv_sec - SOURCE_GC_TIME)
return 0; // Source info too stale to trust
// RFC 8966 §2.4: A route is feasible if D(B) < FD(A)
//TODO: