Hi all,

I think I discovered a bug causing BFD sessions to get stuck in the Init state when taking down and up the interface that is being for the BFD session.

I'm using bird 2.0.7 on linux 4.19.86.

My setup: I have to network namespaces t1 and t2, connected by a veth pair:

ip -n t1 addr show
99: t2_1@if100: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state 
UP group default qlen 1000
    link/ether fa:e1:52:51:62:a3 brd ff:ff:ff:ff:ff:ff link-netns t2
    inet6 2001:db8:1::1/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::f8e1:52ff:fe51:62a3/64 scope link
       valid_lft forever preferred_lft forever

ip -n t2 addr show
100: t1_1@if99: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state 
UP group default qlen 1000
    link/ether b2:0e:f4:60:1b:08 brd ff:ff:ff:ff:ff:ff link-netns t1
    inet6 2001:db8:1::2/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::b00e:f4ff:fe60:1b08/64 scope link
       valid_lft forever preferred_lft forever



The bird config on both sides is almost identical:

t1:
protocol device {
    debug all;
    scan time 10;
}

router id 1.1.1.1;

protocol bfd {
    debug all;
    interface "*" {
        min rx interval 50 ms;
        min tx interval 100 ms;
        idle tx interval 300 ms;

    };
    neighbor 2001:db8:1::2 dev "t2_1" local 2001:db8:1::1;
}

t2:
protocol device {
    debug all;
    scan time 10;
}

router id 2.2.2.2;

protocol bfd {
    debug all;
    interface "*" {
        min rx interval 50 ms;
        min tx interval 100 ms;
        idle tx interval 300 ms;

    };
    neighbor 2001:db8:1::1 dev "t1_1" local 2001:db8:1::2;
}

When starting up bird on both sides, the BFD session comes up just as expected. When taking down the interface t1_1 in netns t2 (ip -n t2 link set down dev t1_1), I see the following log message:

bfd1: Session to 2001:db8:1::1 removed

Now, when taking up the interface instantly, I get the following log message, the BFD session gets stuck in the Init state and does not recover:

bfd1: Socket error: bind: Cannot assign requested address
bfd1: Session to 2001:db8:1::1 added

When I take down the interface and wait for a subsequent device scan (indicated by log message "device1: Scanning interfaces") and only take up the interface after the device scan is carried out, all works fine:

bfd1: Session to 2001:db8:1::1 removed
device1: Scanning interfaces
bfd1: Session to 2001:db8:1::1 added

When leaving out the "scan time" statement in the device protocol configuration, it doesn't seem to recover at all (probably, as the documentation states, a large value is used for the scan time by default).

Thanks in advance for your feedback.

Best Regards
Julian Schuh



















Reply via email to