mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-09 07:56:29 +00:00
zebra: Fix MAC change handling for a neighbor
When the MAC changes for a local neighbor, ensure that the neighbor data structure as well as the link between the neighbor and MAC data structures is updated correctly. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Ticket: CM-17565 Reviewed By: CCR-6605 Testing Done: Manual, evpn-smoke
This commit is contained in:
parent
cb499ebbaa
commit
b682f6de5a
@ -2192,58 +2192,58 @@ char *bgp_evpn_label2str(mpls_label_t *label, char *buf, int len)
|
|||||||
* NOTE: We don't use prefix2str as the output here is a bit different.
|
* NOTE: We don't use prefix2str as the output here is a bit different.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
bgp_evpn_route2json (struct prefix_evpn *p, json_object *json)
|
bgp_evpn_route2json(struct prefix_evpn *p, json_object *json)
|
||||||
{
|
{
|
||||||
char buf1[ETHER_ADDR_STRLEN];
|
char buf1[ETHER_ADDR_STRLEN];
|
||||||
char buf2[PREFIX2STR_BUFFER];
|
char buf2[PREFIX2STR_BUFFER];
|
||||||
|
|
||||||
if (!json)
|
if (!json)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (p->prefix.route_type == BGP_EVPN_IMET_ROUTE) {
|
if (p->prefix.route_type == BGP_EVPN_IMET_ROUTE) {
|
||||||
json_object_int_add (json, "routeType", p->prefix.route_type);
|
json_object_int_add(json, "routeType", p->prefix.route_type);
|
||||||
json_object_int_add (json, "ethTag", 0);
|
json_object_int_add(json, "ethTag", 0);
|
||||||
json_object_int_add (json,
|
json_object_int_add(json,
|
||||||
"ipLen",
|
"ipLen",
|
||||||
IS_EVPN_PREFIX_IPADDR_V4 (p) ?
|
IS_EVPN_PREFIX_IPADDR_V4 (p) ?
|
||||||
IPV4_MAX_BITLEN : IPV6_MAX_BITLEN);
|
IPV4_MAX_BITLEN : IPV6_MAX_BITLEN);
|
||||||
json_object_string_add (json, "ip",
|
json_object_string_add(json, "ip",
|
||||||
inet_ntoa (p->prefix.ip.ipaddr_v4));
|
inet_ntoa (p->prefix.ip.ipaddr_v4));
|
||||||
}
|
}
|
||||||
else if (p->prefix.route_type == BGP_EVPN_MAC_IP_ROUTE) {
|
else if (p->prefix.route_type == BGP_EVPN_MAC_IP_ROUTE) {
|
||||||
if (IS_EVPN_PREFIX_IPADDR_NONE(p)) {
|
if (IS_EVPN_PREFIX_IPADDR_NONE(p)) {
|
||||||
json_object_int_add (json, "routeType", p->prefix.route_type);
|
json_object_int_add(json, "routeType", p->prefix.route_type);
|
||||||
json_object_int_add (json, "esi", 0); /* TODO: we don't support esi yet */
|
json_object_int_add(json, "esi", 0); /* TODO: we don't support esi yet */
|
||||||
json_object_int_add (json, "ethTag", 0);
|
json_object_int_add(json, "ethTag", 0);
|
||||||
json_object_int_add (json, "macLen", 8 * ETH_ALEN);
|
json_object_int_add(json, "macLen", 8 * ETH_ALEN);
|
||||||
json_object_string_add (json, "mac",
|
json_object_string_add(json, "mac",
|
||||||
prefix_mac2str (&p->prefix.mac,
|
prefix_mac2str (&p->prefix.mac,
|
||||||
buf1, sizeof (buf1)));
|
buf1, sizeof (buf1)));
|
||||||
} else {
|
} else {
|
||||||
u_char family;
|
u_char family;
|
||||||
|
|
||||||
family = IS_EVPN_PREFIX_IPADDR_V4(p) ? \
|
family = IS_EVPN_PREFIX_IPADDR_V4(p) ? \
|
||||||
AF_INET : AF_INET6;
|
AF_INET : AF_INET6;
|
||||||
|
|
||||||
json_object_int_add (json, "routeType",
|
json_object_int_add(json, "routeType",
|
||||||
p->prefix.route_type);
|
p->prefix.route_type);
|
||||||
json_object_int_add (json, "esi", 0); /* TODO: we don't support esi yet */
|
json_object_int_add(json, "esi", 0); /* TODO: we don't support esi yet */
|
||||||
json_object_int_add (json, "ethTag", 0);
|
json_object_int_add(json, "ethTag", 0);
|
||||||
json_object_int_add (json, "macLen",
|
json_object_int_add(json, "macLen",
|
||||||
8 * ETH_ALEN);
|
8 * ETH_ALEN);
|
||||||
json_object_string_add (json, "mac",
|
json_object_string_add(json, "mac",
|
||||||
prefix_mac2str (&p->prefix.mac,
|
prefix_mac2str (&p->prefix.mac,
|
||||||
buf1,
|
buf1,
|
||||||
sizeof (buf1)));
|
sizeof (buf1)));
|
||||||
json_object_int_add (json, "ipLen",
|
json_object_int_add(json, "ipLen",
|
||||||
IS_EVPN_PREFIX_IPADDR_V4 (p) ?
|
IS_EVPN_PREFIX_IPADDR_V4 (p) ?
|
||||||
IPV4_MAX_BITLEN :
|
IPV4_MAX_BITLEN :
|
||||||
IPV6_MAX_BITLEN);
|
IPV6_MAX_BITLEN);
|
||||||
json_object_string_add (json, "ip",
|
json_object_string_add(json, "ip",
|
||||||
inet_ntop (family,
|
inet_ntop (family,
|
||||||
&p->prefix.ip.ip.addr,
|
&p->prefix.ip.ip.addr,
|
||||||
buf2,
|
buf2,
|
||||||
PREFIX2STR_BUFFER));
|
PREFIX2STR_BUFFER));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Currently, this is to cater to other AF_ETHERNET code. */
|
/* Currently, this is to cater to other AF_ETHERNET code. */
|
||||||
@ -2683,10 +2683,7 @@ int bgp_filter_evpn_routes_upon_martian_nh_change(struct bgp *bgp)
|
|||||||
if (bgp_debug_update(ri->peer, &rn->p,
|
if (bgp_debug_update(ri->peer, &rn->p,
|
||||||
NULL, 1))
|
NULL, 1))
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%u: prefix %s with "
|
"%u: prefix %s with attr %s - DENIED due to martian or self nexthop",
|
||||||
"attr %s - DENIED"
|
|
||||||
"due to martian or seld"
|
|
||||||
"nexthop",
|
|
||||||
bgp->vrf_id,
|
bgp->vrf_id,
|
||||||
prefix2str(
|
prefix2str(
|
||||||
&rn->p,
|
&rn->p,
|
||||||
|
@ -28,8 +28,7 @@
|
|||||||
extern void bgp_evpn_handle_router_id_update(struct bgp *bgp, int withdraw);
|
extern void bgp_evpn_handle_router_id_update(struct bgp *bgp, int withdraw);
|
||||||
extern char *bgp_evpn_label2str(mpls_label_t *label, char *buf, int len);
|
extern char *bgp_evpn_label2str(mpls_label_t *label, char *buf, int len);
|
||||||
extern char *bgp_evpn_route2str(struct prefix_evpn *p, char *buf, int len);
|
extern char *bgp_evpn_route2str(struct prefix_evpn *p, char *buf, int len);
|
||||||
extern void
|
extern void bgp_evpn_route2json(struct prefix_evpn *p, json_object *json);
|
||||||
bgp_evpn_route2json (struct prefix_evpn *p, json_object *json);
|
|
||||||
extern void bgp_evpn_encode_prefix(struct stream *s, struct prefix *p,
|
extern void bgp_evpn_encode_prefix(struct stream *s, struct prefix *p,
|
||||||
struct prefix_rd *prd, mpls_label_t *label,
|
struct prefix_rd *prd, mpls_label_t *label,
|
||||||
struct attr *attr, int addpath_encode,
|
struct attr *attr, int addpath_encode,
|
||||||
|
@ -76,8 +76,8 @@ static void display_import_rt(struct vty *vty, struct irt_node *irt,
|
|||||||
char rt_buf[RT_ADDRSTRLEN];
|
char rt_buf[RT_ADDRSTRLEN];
|
||||||
|
|
||||||
if (json) {
|
if (json) {
|
||||||
json_rt = json_object_new_object ();
|
json_rt = json_object_new_object();
|
||||||
json_vnis = json_object_new_array ();
|
json_vnis = json_object_new_array();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: This needs to go into a function */
|
/* TODO: This needs to go into a function */
|
||||||
@ -521,6 +521,7 @@ static void show_vni_entry(struct hash_backet *backet, void *args[])
|
|||||||
|
|
||||||
if (json) {
|
if (json) {
|
||||||
char vni_str[VNI_STR_LEN];
|
char vni_str[VNI_STR_LEN];
|
||||||
|
|
||||||
json_object_object_add(json_vni, "exportRTs", json_export_rtl);
|
json_object_object_add(json_vni, "exportRTs", json_export_rtl);
|
||||||
snprintf(vni_str, VNI_STR_LEN, "%u", vpn->vni);
|
snprintf(vni_str, VNI_STR_LEN, "%u", vpn->vni);
|
||||||
json_object_object_add(json, vni_str, json_vni);
|
json_object_object_add(json, vni_str, json_vni);
|
||||||
|
@ -6246,7 +6246,8 @@ static void route_vty_out_route(struct prefix *p, struct vty *vty,
|
|||||||
|| (IN_CLASSB(destination) && p->prefixlen == 16)
|
|| (IN_CLASSB(destination) && p->prefixlen == 16)
|
||||||
|| (IN_CLASSA(destination) && p->prefixlen == 8)
|
|| (IN_CLASSA(destination) && p->prefixlen == 8)
|
||||||
|| p->u.prefix4.s_addr == 0) {
|
|| p->u.prefix4.s_addr == 0) {
|
||||||
/* When mask is natural, mask is not displayed. */
|
/* When mask is natural,
|
||||||
|
mask is not displayed. */
|
||||||
} else
|
} else
|
||||||
len += vty_out(vty, "/%d", p->prefixlen);
|
len += vty_out(vty, "/%d", p->prefixlen);
|
||||||
} else {
|
} else {
|
||||||
@ -6261,12 +6262,12 @@ static void route_vty_out_route(struct prefix *p, struct vty *vty,
|
|||||||
len = vty_out(vty, "%s", buf);
|
len = vty_out(vty, "%s", buf);
|
||||||
} else if (p->family == AF_EVPN) {
|
} else if (p->family == AF_EVPN) {
|
||||||
#if defined(HAVE_CUMULUS)
|
#if defined(HAVE_CUMULUS)
|
||||||
if (!json)
|
if (!json)
|
||||||
len = vty_out (vty, "%s",
|
len = vty_out(vty, "%s",
|
||||||
bgp_evpn_route2str((struct prefix_evpn *)p,
|
bgp_evpn_route2str((struct prefix_evpn *)p,
|
||||||
buf, BUFSIZ));
|
buf, BUFSIZ));
|
||||||
else
|
else
|
||||||
bgp_evpn_route2json ( (struct prefix_evpn *) p, json);
|
bgp_evpn_route2json((struct prefix_evpn *) p, json);
|
||||||
#else
|
#else
|
||||||
prefix2str(p, buf, PREFIX_STRLEN);
|
prefix2str(p, buf, PREFIX_STRLEN);
|
||||||
len = vty_out(vty, "%s", buf);
|
len = vty_out(vty, "%s", buf);
|
||||||
@ -6393,7 +6394,7 @@ void route_vty_out(struct vty *vty, struct prefix *p, struct bgp_info *binfo,
|
|||||||
else
|
else
|
||||||
vty_out(vty, "%*s", 17, " ");
|
vty_out(vty, "%*s", 17, " ");
|
||||||
} else {
|
} else {
|
||||||
route_vty_out_route (p, vty, json_path);
|
route_vty_out_route(p, vty, json_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Print attribute */
|
/* Print attribute */
|
||||||
@ -8379,9 +8380,9 @@ void route_vty_out_detail_header(struct vty *vty, struct bgp *bgp,
|
|||||||
if (has_valid_label)
|
if (has_valid_label)
|
||||||
json_object_int_add(json, "localLabel", label);
|
json_object_int_add(json, "localLabel", label);
|
||||||
|
|
||||||
json_object_string_add (json, "prefix",
|
json_object_string_add(json, "prefix",
|
||||||
prefix2str (p, prefix_str,
|
prefix2str(p, prefix_str,
|
||||||
sizeof (prefix_str)));
|
sizeof(prefix_str)));
|
||||||
} else {
|
} else {
|
||||||
#if defined(HAVE_CUMULUS)
|
#if defined(HAVE_CUMULUS)
|
||||||
if (safi == SAFI_EVPN)
|
if (safi == SAFI_EVPN)
|
||||||
|
@ -9040,8 +9040,7 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, u_char use_json,
|
|||||||
" Hostname Capability:");
|
" Hostname Capability:");
|
||||||
|
|
||||||
if (CHECK_FLAG(p->cap, PEER_CAP_HOSTNAME_ADV)) {
|
if (CHECK_FLAG(p->cap, PEER_CAP_HOSTNAME_ADV)) {
|
||||||
vty_out(vty, " advertised (name: %s, "
|
vty_out(vty, " advertised (name: %s,domain name: %s)",
|
||||||
"domain name: %s)",
|
|
||||||
bgp->peer_self->hostname ?
|
bgp->peer_self->hostname ?
|
||||||
bgp->peer_self->hostname
|
bgp->peer_self->hostname
|
||||||
: "n/a",
|
: "n/a",
|
||||||
@ -9053,8 +9052,7 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, u_char use_json,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (CHECK_FLAG(p->cap, PEER_CAP_HOSTNAME_RCV)) {
|
if (CHECK_FLAG(p->cap, PEER_CAP_HOSTNAME_RCV)) {
|
||||||
vty_out(vty, " received (name: %s, "
|
vty_out(vty, " received (name: %s,domain name: %s)",
|
||||||
"domain name: %s)",
|
|
||||||
p->hostname ?
|
p->hostname ?
|
||||||
p->hostname : "n/a",
|
p->hostname : "n/a",
|
||||||
p->domainname ?
|
p->domainname ?
|
||||||
|
@ -225,17 +225,17 @@ void zebra_l2if_update_bridge_slave(struct interface *ifp,
|
|||||||
|
|
||||||
/* Set up or remove link with master */
|
/* Set up or remove link with master */
|
||||||
if (bridge_ifindex != IFINDEX_INTERNAL) {
|
if (bridge_ifindex != IFINDEX_INTERNAL) {
|
||||||
zebra_l2_map_slave_to_bridge (&zif->brslave_info);
|
zebra_l2_map_slave_to_bridge(&zif->brslave_info);
|
||||||
/* In the case of VxLAN, invoke the handler for EVPN. */
|
/* In the case of VxLAN, invoke the handler for EVPN. */
|
||||||
if (zif->zif_type == ZEBRA_IF_VXLAN)
|
if (zif->zif_type == ZEBRA_IF_VXLAN)
|
||||||
zebra_vxlan_if_update (ifp, ZEBRA_VXLIF_MASTER_CHANGE);
|
zebra_vxlan_if_update(ifp, ZEBRA_VXLIF_MASTER_CHANGE);
|
||||||
} else if (old_bridge_ifindex != IFINDEX_INTERNAL) {
|
} else if (old_bridge_ifindex != IFINDEX_INTERNAL) {
|
||||||
/* In the case of VxLAN, invoke the handler for EVPN. Note that
|
/* In the case of VxLAN, invoke the handler for EVPN.
|
||||||
* this should be done *prior* to unmapping the interface from the
|
* Note that this should be done *prior* to unmapping the interface
|
||||||
* bridge.
|
* from the bridge.
|
||||||
*/
|
*/
|
||||||
if (zif->zif_type == ZEBRA_IF_VXLAN)
|
if (zif->zif_type == ZEBRA_IF_VXLAN)
|
||||||
zebra_vxlan_if_update (ifp, ZEBRA_VXLIF_MASTER_CHANGE);
|
zebra_vxlan_if_update(ifp, ZEBRA_VXLIF_MASTER_CHANGE);
|
||||||
zebra_l2_unmap_slave_from_bridge (&zif->brslave_info);
|
zebra_l2_unmap_slave_from_bridge(&zif->brslave_info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1441,7 +1441,7 @@ static void zvni_gw_macip_del_for_vni_hash(struct hash_backet *backet,
|
|||||||
zif = ifp->info;
|
zif = ifp->info;
|
||||||
|
|
||||||
/* If down or not mapped to a bridge, we're done. */
|
/* If down or not mapped to a bridge, we're done. */
|
||||||
if (!if_is_operative (ifp) || !zif->brslave_info.br_if)
|
if (!if_is_operative(ifp) || !zif->brslave_info.br_if)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
zl2_info = zif->l2info.vxl;
|
zl2_info = zif->l2info.vxl;
|
||||||
@ -1485,7 +1485,7 @@ static void zvni_gw_macip_add_for_vni_hash(struct hash_backet *backet,
|
|||||||
zif = ifp->info;
|
zif = ifp->info;
|
||||||
|
|
||||||
/* If down or not mapped to a bridge, we're done. */
|
/* If down or not mapped to a bridge, we're done. */
|
||||||
if (!if_is_operative (ifp) || !zif->brslave_info.br_if)
|
if (!if_is_operative(ifp) || !zif->brslave_info.br_if)
|
||||||
return;
|
return;
|
||||||
zl2_info = zif->l2info.vxl;
|
zl2_info = zif->l2info.vxl;
|
||||||
|
|
||||||
@ -2889,10 +2889,9 @@ int zebra_vxlan_local_neigh_add_update(struct interface *ifp,
|
|||||||
zebra_vni_t *zvni;
|
zebra_vni_t *zvni;
|
||||||
zebra_neigh_t *n;
|
zebra_neigh_t *n;
|
||||||
struct zebra_vrf *zvrf;
|
struct zebra_vrf *zvrf;
|
||||||
zebra_mac_t *zmac;
|
zebra_mac_t *zmac, *old_zmac;
|
||||||
char buf[ETHER_ADDR_STRLEN];
|
char buf[ETHER_ADDR_STRLEN];
|
||||||
char buf2[INET6_ADDRSTRLEN];
|
char buf2[INET6_ADDRSTRLEN];
|
||||||
int send_upd = 1, send_del = 0;
|
|
||||||
|
|
||||||
/* We are only interested in neighbors on an SVI that resides on top
|
/* We are only interested in neighbors on an SVI that resides on top
|
||||||
* of a VxLAN bridge.
|
* of a VxLAN bridge.
|
||||||
@ -2947,19 +2946,35 @@ int zebra_vxlan_local_neigh_add_update(struct interface *ifp,
|
|||||||
if (memcmp(n->emac.octet, macaddr->octet,
|
if (memcmp(n->emac.octet, macaddr->octet,
|
||||||
ETH_ALEN)
|
ETH_ALEN)
|
||||||
== 0) {
|
== 0) {
|
||||||
if (n->ifindex == ifp->ifindex)
|
/* Update any params and return - client doesn't
|
||||||
/* we're not interested in whatever has
|
* care about a purely local change.
|
||||||
* changed. */
|
|
||||||
return 0;
|
|
||||||
/* client doesn't care about a purely local
|
|
||||||
* change. */
|
|
||||||
send_upd = 0;
|
|
||||||
} else
|
|
||||||
/* If the MAC has changed, issue a delete first
|
|
||||||
* as this means a
|
|
||||||
* different MACIP route.
|
|
||||||
*/
|
*/
|
||||||
send_del = 1;
|
n->ifindex = ifp->ifindex;
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
/* If the MAC has changed,
|
||||||
|
* need to issue a delete first
|
||||||
|
* as this means a different MACIP route.
|
||||||
|
* Also, need to do some unlinking/relinking.
|
||||||
|
*/
|
||||||
|
zvni_neigh_send_del_to_client(zvrf, zvni->vni,
|
||||||
|
&n->ip, &n->emac,
|
||||||
|
0);
|
||||||
|
old_zmac = zvni_mac_lookup(zvni, &n->emac);
|
||||||
|
if (old_zmac) {
|
||||||
|
listnode_delete(old_zmac->neigh_list,
|
||||||
|
n);
|
||||||
|
zvni_deref_ip2mac(zvni, old_zmac, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Set "local" forwarding info. */
|
||||||
|
SET_FLAG(n->flags, ZEBRA_NEIGH_LOCAL);
|
||||||
|
n->ifindex = ifp->ifindex;
|
||||||
|
memcpy(&n->emac, macaddr, ETH_ALEN);
|
||||||
|
|
||||||
|
/* Link to new MAC */
|
||||||
|
listnode_add_sort(zmac->neigh_list, n);
|
||||||
|
}
|
||||||
} else if (ext_learned)
|
} else if (ext_learned)
|
||||||
/* The neighbor is remote and that is the notification we got.
|
/* The neighbor is remote and that is the notification we got.
|
||||||
*/
|
*/
|
||||||
@ -2973,6 +2988,8 @@ int zebra_vxlan_local_neigh_add_update(struct interface *ifp,
|
|||||||
{
|
{
|
||||||
UNSET_FLAG(n->flags, ZEBRA_NEIGH_REMOTE);
|
UNSET_FLAG(n->flags, ZEBRA_NEIGH_REMOTE);
|
||||||
n->r_vtep_ip.s_addr = 0;
|
n->r_vtep_ip.s_addr = 0;
|
||||||
|
SET_FLAG(n->flags, ZEBRA_NEIGH_LOCAL);
|
||||||
|
n->ifindex = ifp->ifindex;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
n = zvni_neigh_add(zvni, ip, macaddr);
|
n = zvni_neigh_add(zvni, ip, macaddr);
|
||||||
@ -2984,17 +3001,11 @@ int zebra_vxlan_local_neigh_add_update(struct interface *ifp,
|
|||||||
ifp->name, ifp->ifindex, zvni->vni);
|
ifp->name, ifp->ifindex, zvni->vni);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
/* Set "local" forwarding info. */
|
||||||
|
SET_FLAG(n->flags, ZEBRA_NEIGH_LOCAL);
|
||||||
|
n->ifindex = ifp->ifindex;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Issue delete for older info, if needed. */
|
|
||||||
if (send_del)
|
|
||||||
zvni_neigh_send_del_to_client(zvrf, zvni->vni, &n->ip, &n->emac,
|
|
||||||
0);
|
|
||||||
|
|
||||||
/* Set "local" forwarding info. */
|
|
||||||
SET_FLAG(n->flags, ZEBRA_NEIGH_LOCAL);
|
|
||||||
n->ifindex = ifp->ifindex;
|
|
||||||
|
|
||||||
/* Before we program this in BGP, we need to check if MAC is locally
|
/* Before we program this in BGP, we need to check if MAC is locally
|
||||||
* learnt as well */
|
* learnt as well */
|
||||||
if (!CHECK_FLAG(zmac->flags, ZEBRA_MAC_LOCAL)) {
|
if (!CHECK_FLAG(zmac->flags, ZEBRA_MAC_LOCAL)) {
|
||||||
@ -3008,23 +3019,20 @@ int zebra_vxlan_local_neigh_add_update(struct interface *ifp,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Inform BGP if required. */
|
/* Inform BGP. */
|
||||||
if (send_upd) {
|
if (IS_ZEBRA_DEBUG_VXLAN)
|
||||||
if (IS_ZEBRA_DEBUG_VXLAN)
|
zlog_debug(
|
||||||
zlog_debug(
|
"%u: neigh %s (MAC %s) is now ACTIVE on VNI %u",
|
||||||
"%u: neigh %s (MAC %s) is now ACTIVE on VNI %u",
|
ifp->vrf_id, ipaddr2str(ip, buf2, sizeof(buf2)),
|
||||||
ifp->vrf_id, ipaddr2str(ip, buf2, sizeof(buf2)),
|
prefix_mac2str(macaddr, buf, sizeof(buf)),
|
||||||
prefix_mac2str(macaddr, buf, sizeof(buf)),
|
zvni->vni);
|
||||||
zvni->vni);
|
|
||||||
|
|
||||||
ZEBRA_NEIGH_SET_ACTIVE(n);
|
ZEBRA_NEIGH_SET_ACTIVE(n);
|
||||||
return zvni_neigh_send_add_to_client(zvrf, zvni->vni, ip,
|
return zvni_neigh_send_add_to_client(zvrf, zvni->vni, ip,
|
||||||
macaddr, 0);
|
macaddr, 0);
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Handle message from client to delete a remote MACIP for a VNI.
|
* Handle message from client to delete a remote MACIP for a VNI.
|
||||||
*/
|
*/
|
||||||
@ -3096,7 +3104,7 @@ int zebra_vxlan_remote_macip_del(struct zserv *client, int sock, u_short length,
|
|||||||
zif = ifp->info;
|
zif = ifp->info;
|
||||||
|
|
||||||
/* If down or not mapped to a bridge, we're done. */
|
/* If down or not mapped to a bridge, we're done. */
|
||||||
if (!if_is_operative (ifp) || !zif->brslave_info.br_if)
|
if (!if_is_operative(ifp) || !zif->brslave_info.br_if)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* The remote VTEP specified is normally expected to exist, but
|
/* The remote VTEP specified is normally expected to exist, but
|
||||||
@ -3246,7 +3254,7 @@ int zebra_vxlan_remote_macip_add(struct zserv *client, int sock, u_short length,
|
|||||||
zif = ifp->info;
|
zif = ifp->info;
|
||||||
|
|
||||||
/* If down or not mapped to a bridge, we're done. */
|
/* If down or not mapped to a bridge, we're done. */
|
||||||
if (!if_is_operative (ifp) || !zif->brslave_info.br_if)
|
if (!if_is_operative(ifp) || !zif->brslave_info.br_if)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* The remote VTEP specified should normally exist, but it is
|
/* The remote VTEP specified should normally exist, but it is
|
||||||
@ -3738,14 +3746,14 @@ int zebra_vxlan_remote_vtep_del(struct zserv *client, int sock, u_short length,
|
|||||||
|
|
||||||
ifp = zvni->vxlan_if;
|
ifp = zvni->vxlan_if;
|
||||||
if (!ifp) {
|
if (!ifp) {
|
||||||
zlog_err ("VNI %u hash %p doesn't have intf upon remote VTEP DEL",
|
zlog_err("VNI %u hash %p doesn't have intf upon remote VTEP DEL",
|
||||||
zvni->vni, zvni);
|
zvni->vni, zvni);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
zif = ifp->info;
|
zif = ifp->info;
|
||||||
|
|
||||||
/* If down or not mapped to a bridge, we're done. */
|
/* If down or not mapped to a bridge, we're done. */
|
||||||
if (!if_is_operative (ifp) || !zif->brslave_info.br_if)
|
if (!if_is_operative(ifp) || !zif->brslave_info.br_if)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* If the remote VTEP does not exist, there's nothing more to
|
/* If the remote VTEP does not exist, there's nothing more to
|
||||||
@ -3817,10 +3825,11 @@ int zebra_vxlan_remote_vtep_add(struct zserv *client, int sock, u_short length,
|
|||||||
zif = ifp->info;
|
zif = ifp->info;
|
||||||
|
|
||||||
/* If down or not mapped to a bridge, we're done. */
|
/* If down or not mapped to a bridge, we're done. */
|
||||||
if (!if_is_operative (ifp) || !zif->brslave_info.br_if)
|
if (!if_is_operative(ifp) || !zif->brslave_info.br_if)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* If the remote VTEP already exists, there's nothing more to do. */
|
/* If the remote VTEP already exists,
|
||||||
|
there's nothing more to do. */
|
||||||
if (zvni_vtep_find(zvni, &vtep_ip))
|
if (zvni_vtep_find(zvni, &vtep_ip))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -4366,7 +4375,7 @@ int zebra_vxlan_advertise_gw_macip(struct zserv *client, int sock,
|
|||||||
zif = ifp->info;
|
zif = ifp->info;
|
||||||
|
|
||||||
/* If down or not mapped to a bridge, we're done. */
|
/* If down or not mapped to a bridge, we're done. */
|
||||||
if (!if_is_operative (ifp) || !zif->brslave_info.br_if)
|
if (!if_is_operative(ifp) || !zif->brslave_info.br_if)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
zl2_info = zif->l2info.vxl;
|
zl2_info = zif->l2info.vxl;
|
||||||
|
Loading…
Reference in New Issue
Block a user