Skip to content

babeld: update_feasible() accepts updates as feasible even when the source is NULL or the source’s data is stale #18554

@zmw12306

Description

@zmw12306

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions