Skip to content

bfdd: Session state is not maintained until Detection Time after session goes down #18593

@zmw12306

Description

@zmw12306

The BFD implementation does not fully comply with RFC 5880 Section 6.8.18, which requires maintaining session state (including timing parameters) until a full Detection Time has passed without receiving BFD Control packets. Currently, session state is prematurely cleared in bfd_session_disable().

A system is REQUIRED to maintain session state (including timing parameters), even when a session is down, until a Detection Time has passed without the receipt of any BFD Control packets.

However,

frr/bfdd/bfd.c

Lines 413 to 435 in 259ffe1

void bfd_session_disable(struct bfd_session *bs)
{
/* We are using data plane, we don't need software. */
if (bs->bdc)
return;
/* Free up socket resources. */
if (bs->sock != -1) {
close(bs->sock);
bs->sock = -1;
}
/* Disable all timers. */
bfd_recvtimer_delete(bs);
bfd_xmttimer_delete(bs);
ptm_bfd_echo_stop(bs);
bs->vrf = NULL;
bs->ifp = NULL;
/* Set session down so it doesn't report UP and disabled. */
ptm_bfd_sess_dn(bs, BD_PATH_DOWN);
}

This code:

Deletes receive/transmit timers immediately
Clears essential session state (e.g., vrf, ifp)
Does not retain state or timing information for the required Detection Time duration

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