]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: pass correct vrf_id to vrf_socket when creating bgp view socket
authorIgor Ryzhov <iryzhov@nfware.com>
Mon, 31 May 2021 19:12:31 +0000 (22:12 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Mon, 31 May 2021 19:12:55 +0000 (22:12 +0300)
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
bgpd/bgp_network.c

index 860c5fd382f3c26ced4b37da89e780c6a8954707..137f0a6b59dca11a8bee219e66ca9e21d4a10693 100644 (file)
@@ -895,7 +895,10 @@ int bgp_socket(struct bgp *bgp, unsigned short port, const char *address)
                frr_with_privs(&bgpd_privs) {
                        sock = vrf_socket(ainfo->ai_family,
                                          ainfo->ai_socktype,
-                                         ainfo->ai_protocol, bgp->vrf_id,
+                                         ainfo->ai_protocol,
+                                         (bgp->inst_type
+                                          != BGP_INSTANCE_TYPE_VIEW
+                                          ? bgp->vrf_id : VRF_DEFAULT),
                                          (bgp->inst_type
                                           == BGP_INSTANCE_TYPE_VRF
                                           ? bgp->name : NULL));