]> git.puffer.fish Git - mirror/frr.git/commit
bfdd: Fix malformed session with vrf 13572/head
authoranlan_cs <vic.lan@pica8.com>
Wed, 10 May 2023 14:04:33 +0000 (22:04 +0800)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Mon, 22 May 2023 11:25:56 +0000 (11:25 +0000)
commit2d8eaf6668ed4bad9b126b662f61751b3e51c0d4
tree0a4bfa3be933e7e037edeb93159731924a43c143
parentd6c72a07aed870990de43d796c994e42d17f7a5c
bfdd: Fix malformed session with vrf

With this configuration:

```
bfd
 peer 33:33::66 local-address 33:33::88 vrf vrf8 interface enp1s0
 exit
 !
exit
```

The bfd session can't be established with error:

```
bfdd[18663]: [YA0Q5-C0BPV] control-packet: wrong vrfid. [mhop:no peer:33:33::66 local:33:33::88 port:2 vrf:61]
```

The vrf check should use the carefully adjusted `vrfid`, which is
based on globally/reliable interface.  We can't believe the
`bvrf->vrf->vrf_id` because the `/proc/sys/net/ipv4/udp_l3mdev_accept`
maybe is set "1" in VRF-lite backend even with security drawback.

Just correct the vrf check.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
(cherry picked from commit b17c179664da7331a4669a1cf548e4e9c48a5477)
bfdd/bfd_packet.c