bfd does not work in a vrf

Alexander Zubkov green at qrator.net
Wed Jul 17 15:08:45 CEST 2019


On Wed, Jul 17, 2019 at 2:47 PM Ondrej Zajicek <santiago at crfreenet.org> wrote:
>
> On Wed, Jul 17, 2019 at 12:05:49PM +0200, Alexander Zubkov wrote:
> > Hello,
> >
> > I made small fix for myself, that allow bfd to work in one VRF,
> > defined in the configuration:
> >
> > --- a/proto/bfd/packets.c
> > +++ b/proto/bfd/packets.c
> > @@ -413,6 +413,7 @@ bfd_open_rx_sk(struct bfd_proto *p, int multihop, int af)
> >    sk->type = SK_UDP;
> >    sk->subtype = af;
> >    sk->sport = !multihop ? BFD_CONTROL_PORT : BFD_MULTI_CTL_PORT;
> > +  sk->vrf = p->p.vrf;
> >    sk->data = p;
> >
> >    sk->rbsize = BFD_MAX_LEN;
> >
> > It works, but I suppose vrf change should be handled somehow in
> > bfd_reconfigure also. Not sure if reopening socket is enough or it
>
> Hello
>
> This would work, it is necessary to also set sk->vrf for bfd_open_tx_sk()
> foir multihop BFD. It is not necessary to handle it in bfd_reconfigure(),
> as VRF change is handled in generic code in proto_reconfigure().
>
> I also just implemented BFD request dispatch based on VRFs to handle multiple
> VRFs and multiple BFD instances.

Oh! I was just trying to figure out it myself today too. See the
attached patch. :)
It adds vrf parameter to the bfd_request and bfd_request_session
funciton. Not sure though that I passed vrf correctly from all
protocols.

>
> --
> Elen sila lumenn' omentielvo
>
> Ondrej 'Santiago' Zajicek (email: santiago at 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."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bfd-vrf.patch
Type: text/x-patch
Size: 5655 bytes
Desc: not available
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20190717/001128e1/attachment.bin>


More information about the Bird-users mailing list