From: Chirag Shah Date: Sat, 17 Nov 2018 01:30:15 +0000 (-0800) Subject: bgp, zebra: address review comments X-Git-Tag: frr-7.1-dev~165^2~2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=979777b2d7734fdd62a8fde02f090d823f476fee;p=mirror%2Ffrr.git bgp, zebra: address review comments Signed-off-by: Chirag Shah --- diff --git a/bgpd/bgp_evpn_vty.c b/bgpd/bgp_evpn_vty.c index 729fa67482..02bb681876 100644 --- a/bgpd/bgp_evpn_vty.c +++ b/bgpd/bgp_evpn_vty.c @@ -3003,7 +3003,7 @@ DEFPY (dup_addr_detection, dup_addr_detection_cmd, "dup-addr-detection [max-moves (2-1000)$max_moves_val time (2-1800)$time_val]", "Duplicate address detection\n" - "Max allowed moved before address detected as duplicate\n" + "Max allowed moves before address detected as duplicate\n" "Num of max allowed moves (2-1000) default 5\n" "Duplicate address detection time\n" "Time in seconds (2-1800) default 180\n") @@ -3053,7 +3053,7 @@ DEFPY (no_dup_addr_detection, "no dup-addr-detection [max-moves (2-1000)$max_moves_val time (2-1800)$time_val | freeze ]", NO_STR "Duplicate address detection\n" - "Max allowed moved before address detected as duplicate\n" + "Max allowed moves before address detected as duplicate\n" "Num of max allowed moves (2-1000) default 5\n" "Duplicate address detection time\n" "Time in seconds (2-1800) default 180\n" diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c index e06db0abc5..34bae8dc60 100644 --- a/zebra/zebra_vxlan.c +++ b/zebra/zebra_vxlan.c @@ -321,7 +321,8 @@ static int advertise_gw_macip_enabled(zebra_vni_t *zvni) } /* As part Duplicate Address Detection (DAD) for IP mobility - * MAC binding changes, ensure to inheirt duplicate flag + * MAC binding changes, ensure to inherit duplicate flag + * from MAC. */ static int zebra_vxlan_ip_inherit_dad_from_mac(struct zebra_vrf *zvrf, zebra_mac_t *old_zmac, @@ -395,10 +396,13 @@ static void zvni_print_neigh(zebra_neigh_t *n, void *ctxt, json_object *json) const char *type_str; const char *state_str; bool flags_present = false; - struct zebra_vrf *zvrf; + struct zebra_vrf *zvrf = NULL; struct timeval detect_start_time = {0, 0}; zvrf = zebra_vrf_lookup_by_id(n->zvni->vrf_id); + if (!zvrf) + return; + ipaddr2str(&n->ip, buf2, sizeof(buf2)); prefix_mac2str(&n->emac, buf1, sizeof(buf1)); type_str = CHECK_FLAG(n->flags, ZEBRA_NEIGH_LOCAL) ? @@ -8644,15 +8648,15 @@ static int zebra_vxlan_dad_ip_auto_recovery_exp(struct thread *t) /* since this is asynchronous we need sanity checks*/ zvrf = vrf_info_lookup(nbr->zvni->vrf_id); if (!zvrf) - goto exit; + return 0; zvni = zvni_lookup(nbr->zvni->vni); if (!zvni) - goto exit; + return 0; nbr = zvni_neigh_lookup(zvni, &nbr->ip); if (!nbr) - goto exit; + return 0; if (IS_ZEBRA_DEBUG_VXLAN) zlog_debug("%s: duplicate addr MAC %s IP %s flags 0x%x learn count %u vni %u auto recovery expired", @@ -8677,7 +8681,6 @@ static int zebra_vxlan_dad_ip_auto_recovery_exp(struct thread *t) zvni_neigh_install(zvni, nbr); } -exit: return 0; } @@ -8695,15 +8698,15 @@ static int zebra_vxlan_dad_mac_auto_recovery_exp(struct thread *t) /* since this is asynchronous we need sanity checks*/ zvrf = vrf_info_lookup(mac->zvni->vrf_id); if (!zvrf) - goto exit; + return 0; zvni = zvni_lookup(mac->zvni->vni); if (!zvni) - goto exit; + return 0; mac = zvni_mac_lookup(zvni, &mac->macaddr); if (!mac) - goto exit; + return 0; if (IS_ZEBRA_DEBUG_VXLAN) zlog_debug("%s: duplicate addr mac %s flags 0x%x learn count %u host count %u auto recovery expired", @@ -8751,6 +8754,5 @@ static int zebra_vxlan_dad_mac_auto_recovery_exp(struct thread *t) zvni_mac_install(zvni, mac); } -exit: return 0; }