struct bgp *bgp;
bgp = bgp_lookup_by_vrf_id(vrf_id);
- if (!bgp)
- return 0;
s = zclient->ibuf;
ifp = zebra_interface_state_read(s, vrf_id);
if (BGP_DEBUG(zebra, ZEBRA))
zlog_debug("Rx Intf del VRF %u IF %s", vrf_id, ifp->name);
- bgp_update_interface_nbrs(bgp, ifp, NULL);
+ if (bgp)
+ bgp_update_interface_nbrs(bgp, ifp, NULL);
if_set_index(ifp, IFINDEX_INTERNAL);
return 0;
struct bgp *bgp;
bgp = bgp_lookup_by_vrf_id(vrf_id);
- if (!bgp)
- return 0;
s = zclient->ibuf;
ifp = zebra_interface_state_read(s, vrf_id);
if (BGP_DEBUG(zebra, ZEBRA))
zlog_debug("Rx Intf up VRF %u IF %s", vrf_id, ifp->name);
+ if (!bgp)
+ return 0;
+
for (ALL_LIST_ELEMENTS(ifp->connected, node, nnode, c))
bgp_connected_add(bgp, c);
struct peer *peer;
bgp = bgp_lookup_by_vrf_id(vrf_id);
- if (!bgp)
- return 0;
s = zclient->ibuf;
ifp = zebra_interface_state_read(s, vrf_id);
if (BGP_DEBUG(zebra, ZEBRA))
zlog_debug("Rx Intf down VRF %u IF %s", vrf_id, ifp->name);
+ if (!bgp)
+ return 0;
+
for (ALL_LIST_ELEMENTS(ifp->connected, node, nnode, c))
bgp_connected_delete(bgp, c);
struct bgp *bgp;
bgp = bgp_lookup_by_vrf_id(vrf_id);
- if (!bgp)
- return 0;
ifc = zebra_interface_address_read(command, zclient->ibuf, vrf_id);
ifc->ifp->name, buf);
}
+ if (!bgp)
+ return 0;
+
if (if_is_operative(ifc->ifp)) {
bgp_connected_add(bgp, ifc);
struct bgp *bgp;
bgp = bgp_lookup_by_vrf_id(vrf_id);
- if (!bgp)
- return 0;
ifc = zebra_interface_address_read(command, zclient->ibuf, vrf_id);
ifc->ifp->name, buf);
}
- if (if_is_operative(ifc->ifp)) {
+ if (bgp && if_is_operative(ifc->ifp)) {
bgp_connected_delete(bgp, ifc);
}
ifp->name, new_vrf_id);
bgp = bgp_lookup_by_vrf_id(vrf_id);
- if (!bgp)
- return 0;
- for (ALL_LIST_ELEMENTS(ifp->connected, node, nnode, c))
- bgp_connected_delete(bgp, c);
+ if (bgp) {
+ for (ALL_LIST_ELEMENTS(ifp->connected, node, nnode, c))
+ bgp_connected_delete(bgp, c);
- for (ALL_LIST_ELEMENTS(ifp->nbr_connected, node, nnode, nc))
- bgp_nbr_connected_delete(bgp, nc, 1);
+ for (ALL_LIST_ELEMENTS(ifp->nbr_connected, node, nnode, nc))
+ bgp_nbr_connected_delete(bgp, nc, 1);
- /* Fast external-failover */
- if (!CHECK_FLAG(bgp->flags, BGP_FLAG_NO_FAST_EXT_FAILOVER)) {
- for (ALL_LIST_ELEMENTS(bgp->peer, node, nnode, peer)) {
- if ((peer->ttl != 1) && (peer->gtsm_hops != 1))
- continue;
+ /* Fast external-failover */
+ if (!CHECK_FLAG(bgp->flags, BGP_FLAG_NO_FAST_EXT_FAILOVER)) {
+ for (ALL_LIST_ELEMENTS(bgp->peer, node, nnode, peer)) {
+ if ((peer->ttl != 1) && (peer->gtsm_hops != 1))
+ continue;
- if (ifp == peer->nexthop.ifp)
- BGP_EVENT_ADD(peer, BGP_Stop);
+ if (ifp == peer->nexthop.ifp)
+ BGP_EVENT_ADD(peer, BGP_Stop);
+ }
}
}
stream_put(s, pbim->ipset_name,
ZEBRA_IPSET_NAME_SIZE);
-
-
}
static void bgp_encode_pbr_ipset_entry_match(struct stream *s,
struct interface *br_if;
struct zebra_if *br_zif;
char buf[ETHER_ADDR_STRLEN];
- int vid_present = 0, dst_present = 0;
+ int vid_present = 0;
char vid_buf[20];
char dst_buf[30];
struct zebra_vrf *zvrf = zebra_vrf_lookup_by_id(ifp->vrf_id);
req.ndm.ndm_ifindex = ifp->ifindex;
dst_alen = 4; // TODO: hardcoded
addattr_l(&req.n, sizeof(req), NDA_DST, &vtep_ip, dst_alen);
- dst_present = 1;
sprintf(dst_buf, " dst %s", inet_ntoa(vtep_ip));
br_zif = (struct zebra_if *)br_if->info;
if (IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(br_zif) && vid > 0) {
nl_family_to_str(req.ndm.ndm_family), ifp->name,
ifp->ifindex, vid_present ? vid_buf : "",
sticky ? "sticky " : "",
- prefix_mac2str(mac, buf, sizeof(buf)),
- dst_present ? dst_buf : "");
+ prefix_mac2str(mac, buf, sizeof(buf)), dst_buf);
return netlink_talk(netlink_talk_filter, &req.n, &zns->netlink_cmd, zns,
0);