BFD getting stuck in Init state when taking down and up the interface
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
On Mon, Jan 20, 2020 at 02:41:58PM +0100, Julian Schuh wrote:
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.
Hi Hi, will check that. It is strange, as the session is restarted when iface goes up and address range is detected, so it should not be an issue to assume IP address is here and ready. Perhaps it is related to DAD, but if i remember correctly, we fixed that issue earlier (addresses with DAD running are not considered available).
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:
I do not think that device scan itself is relevant - perhaps it is just larger delay between down and up events. -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
participants (2)
-
Julian Schuh -
Ondrej Zajicek