summaryrefslogtreecommitdiff
path: root/zebra/zebra_errors.h
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2021-05-07 02:49:40 +0300
committerIgor Ryzhov <iryzhov@nfware.com>2021-05-31 22:12:55 +0300
commit36eef8586d80173a9d64e4b802584014b3780558 (patch)
tree1f423b7d10f02c029f3a31c63510e3d75a9148c2 /zebra/zebra_errors.h
parent676847384b1ed65431ded346f8514d0dafddd630 (diff)
lib: fix binding to a vrf
There are two possible use-cases for the `vrf_bind` function: - bind socket to an interface in a vrf - bind socket to a vrf device For the former case, there's one problem - success is returned when the interface is not found. In that case, the socket is left unbound without throwing an error. For the latter case, there are multiple possible problems: - If the name is not set, then the socket is left unbound (zebra, vrrp). - If the name is "default" and there's an interface with that name in the default VRF, then the socket is bound to that interface. - In most daemons, if the router is configured before the VRF is actually created, we're trying to open and bind the socket right after the daemon receives a VRF registration from zebra. We may not receive the VRF-interface registration from zebra yet at that point. Therefore, `if_lookup_by_name` fails, and the socket is left unbound. This commit fixes all the issues and updates the function description. Suggested-by: Pat Ruddy <pat@voltanet.io> Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'zebra/zebra_errors.h')
0 files changed, 0 insertions, 0 deletions