diff options
Diffstat (limited to 'bgpd/rfapi/vnc_zebra.c')
| -rw-r--r-- | bgpd/rfapi/vnc_zebra.c | 47 |
1 files changed, 13 insertions, 34 deletions
diff --git a/bgpd/rfapi/vnc_zebra.c b/bgpd/rfapi/vnc_zebra.c index 4c55c2f633..82c08cabde 100644 --- a/bgpd/rfapi/vnc_zebra.c +++ b/bgpd/rfapi/vnc_zebra.c @@ -171,32 +171,11 @@ static void vnc_redistribute_add(struct prefix *p, uint32_t metric, * Same setup as in rfapi_open() */ vncHD1VR.peer = peer_new(bgp); - vncHD1VR.peer->status = + vncHD1VR.peer->connection->status = Established; /* keep bgp core happy */ - bgp_sync_delete(vncHD1VR.peer); /* don't need these */ - /* - * since this peer is not on the I/O thread, this lock - * is not strictly necessary, but serves as a reminder - * to those who may meddle... - */ - frr_with_mutex (&vncHD1VR.peer->io_mtx) { - // we don't need any I/O related facilities - if (vncHD1VR.peer->ibuf) - stream_fifo_free(vncHD1VR.peer->ibuf); - if (vncHD1VR.peer->obuf) - stream_fifo_free(vncHD1VR.peer->obuf); - - if (vncHD1VR.peer->ibuf_work) - ringbuf_del(vncHD1VR.peer->ibuf_work); - if (vncHD1VR.peer->obuf_work) - stream_free(vncHD1VR.peer->obuf_work); - - vncHD1VR.peer->ibuf = NULL; - vncHD1VR.peer->obuf = NULL; - vncHD1VR.peer->obuf_work = NULL; - vncHD1VR.peer->ibuf_work = NULL; - } + bgp_peer_connection_buffers_free( + vncHD1VR.peer->connection); /* base code assumes have valid host pointer */ vncHD1VR.peer->host = @@ -560,9 +539,9 @@ static void vnc_zebra_add_del_prefix(struct bgp *bgp, return; } - if (!vrf_bitmap_check( - zclient_vnc->redist[family2afi(p->family)][ZEBRA_ROUTE_VNC], - VRF_DEFAULT)) + if (!vrf_bitmap_check(&zclient_vnc->redist[family2afi(p->family)] + [ZEBRA_ROUTE_VNC], + VRF_DEFAULT)) return; if (!bgp->rfapi_cfg) { @@ -622,7 +601,7 @@ static void vnc_zebra_add_del_nve(struct bgp *bgp, struct rfapi_descriptor *rfd, if (zclient_vnc->sock < 0) return; - if (!vrf_bitmap_check(zclient_vnc->redist[afi][ZEBRA_ROUTE_VNC], + if (!vrf_bitmap_check(&zclient_vnc->redist[afi][ZEBRA_ROUTE_VNC], VRF_DEFAULT)) return; @@ -819,12 +798,12 @@ int vnc_redistribute_set(struct bgp *bgp, afi_t afi, int type) // bgp->redist[afi][type] = 1; /* Return if already redistribute flag is set. */ - if (vrf_bitmap_check(zclient_vnc->redist[afi][type], VRF_DEFAULT)) + if (vrf_bitmap_check(&zclient_vnc->redist[afi][type], VRF_DEFAULT)) return CMD_WARNING_CONFIG_FAILED; - vrf_bitmap_set(zclient_vnc->redist[afi][type], VRF_DEFAULT); + vrf_bitmap_set(&zclient_vnc->redist[afi][type], VRF_DEFAULT); - // vrf_bitmap_set(zclient_vnc->redist[afi][type], VRF_DEFAULT); + // vrf_bitmap_set(&zclient_vnc->redist[afi][type], VRF_DEFAULT); /* Return if zebra connection is not established. */ if (zclient_vnc->sock < 0) @@ -855,9 +834,9 @@ int vnc_redistribute_unset(struct bgp *bgp, afi_t afi, int type) bgp->rfapi_cfg->redist[afi][type] = 0; /* Return if zebra connection is disabled. */ - if (!vrf_bitmap_check(zclient_vnc->redist[afi][type], VRF_DEFAULT)) + if (!vrf_bitmap_check(&zclient_vnc->redist[afi][type], VRF_DEFAULT)) return CMD_WARNING_CONFIG_FAILED; - vrf_bitmap_unset(zclient_vnc->redist[afi][type], VRF_DEFAULT); + vrf_bitmap_unset(&zclient_vnc->redist[afi][type], VRF_DEFAULT); if (bgp->rfapi_cfg->redist[AFI_IP][type] == 0 && bgp->rfapi_cfg->redist[AFI_IP6][type] == 0 @@ -893,7 +872,7 @@ static zclient_handler *const vnc_handlers[] = { void vnc_zebra_init(struct event_loop *master) { /* Set default values. */ - zclient_vnc = zclient_new(master, &zclient_options_default, + zclient_vnc = zclient_new(master, &zclient_options_auxiliary, vnc_handlers, array_size(vnc_handlers)); zclient_init(zclient_vnc, ZEBRA_ROUTE_VNC, 0, &bgpd_privs); } |
