]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: Convert bgp_evpn.c to use flow_warn
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 16 Aug 2018 12:58:01 +0000 (08:58 -0400)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 6 Sep 2018 20:50:58 +0000 (20:50 +0000)
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd/bgp_errors.c
bgpd/bgp_errors.h
bgpd/bgp_evpn.c

index b9f814af2a9490df1c3efa6396559d2559eb2506..afe669ed1e6bbe69574ffced71dc5f7e4f86bbae 100644 (file)
@@ -127,6 +127,24 @@ static struct log_ref ferr_bgp_warn[] = {
                .description = "BGP attempted to set the SO_MARK option for a socket and was unable to do so",
                .suggestion = "Please collect log files and open Issue",
        },
+       {
+               .code = BGP_WARN_EVPN_PMSI_PRESENT,
+               .title = "BGP Received a EVPN NLRI with PMSI included",
+               .description = "BGP has received a type-3 NLRI with PMSI information.  At this time FRR is not capable of properly handling this NLRI type",
+               .suggestion = "Setup peer to not send this type of data to FRR"
+       },
+       {
+               .code = BGP_WARN_EVPN_VPN_VNI,
+               .title = "BGP has received a local macip and cannot properly handle it",
+               .description = "BGP has received a local macip from zebra and has no way to properly handle the macip because the vni is not setup properly",
+               .suggestion = "Ensure proper setup of BGP EVPN",
+       },
+       {
+               .code = BGP_WARN_EVPN_ESI,
+               .title = "BGP has received a local ESI for deletion",
+               .description = "BGP has received a local ESI for deletion but when attempting to find the stored data internally was unable to find the information for deletion",
+               .suggestion = "Gather logging and open an Issue",
+       },
        {
                .code = END_FERR,
        }
index c47a600082e95cc3cdb1b16ff1356f8a122b94f0..95202cdb04d9fcd8fe00dd6c419bec434ffeef1c 100644 (file)
@@ -89,6 +89,9 @@ enum bgp_log_refs {
        BGP_WARN_UNRECOGNIZED_CAPABILITY,
        BGP_WARN_NO_TCP_MD5,
        BGP_WARN_NO_SOCKOPT_MARK,
+       BGP_WARN_EVPN_PMSI_PRESENT,
+       BGP_WARN_EVPN_VPN_VNI,
+       BGP_WARN_EVPN_ESI,
 };
 
 extern void bgp_error_init(void);
index a104a2e16d669439539cc71bde0ac39606a40825..713179ab973a052502bfdc5250058118dddeaadd 100644 (file)
@@ -3683,7 +3683,8 @@ static int process_type3_route(struct peer *peer, afi_t afi, safi_t safi,
        if (attr &&
            (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_PMSI_TUNNEL))) {
                if (attr->pmsi_tnl_type != PMSI_TNLTYPE_INGR_REPL) {
-                       zlog_warn("%u:%s - Rx EVPN Type-3 NLRI with unsupported PTA %d",
+                       flog_warn(BGP_WARN_EVPN_PMSI_PRESENT,
+                                 "%u:%s - Rx EVPN Type-3 NLRI with unsupported PTA %d",
                                  peer->bgp->vrf_id, peer->host,
                                  attr->pmsi_tnl_type);
                }
@@ -5162,7 +5163,8 @@ int bgp_evpn_local_macip_del(struct bgp *bgp, vni_t vni, struct ethaddr *mac,
        /* Lookup VNI hash - should exist. */
        vpn = bgp_evpn_lookup_vni(bgp, vni);
        if (!vpn || !is_vni_live(vpn)) {
-               zlog_warn("%u: VNI hash entry for VNI %u %s at MACIP DEL",
+               flog_warn(BGP_WARN_EVPN_VPN_VNI,
+                         "%u: VNI hash entry for VNI %u %s at MACIP DEL",
                          bgp->vrf_id, vni, vpn ? "not live" : "not found");
                return -1;
        }
@@ -5186,7 +5188,8 @@ int bgp_evpn_local_macip_add(struct bgp *bgp, vni_t vni, struct ethaddr *mac,
        /* Lookup VNI hash - should exist. */
        vpn = bgp_evpn_lookup_vni(bgp, vni);
        if (!vpn || !is_vni_live(vpn)) {
-               zlog_warn("%u: VNI hash entry for VNI %u %s at MACIP ADD",
+               flog_warn(BGP_WARN_EVPN_VPN_VNI,
+                         "%u: VNI hash entry for VNI %u %s at MACIP ADD",
                          bgp->vrf_id, vni, vpn ? "not live" : "not found");
                return -1;
        }
@@ -5398,9 +5401,9 @@ int bgp_evpn_local_vni_del(struct bgp *bgp, vni_t vni)
        vpn = bgp_evpn_lookup_vni(bgp, vni);
        if (!vpn) {
                if (bgp_debug_zebra(NULL))
-                       zlog_warn(
-                               "%u: VNI hash entry for VNI %u not found at DEL",
-                               bgp->vrf_id, vni);
+                       flog_warn(BGP_WARN_EVPN_VPN_VNI,
+                                 "%u: VNI hash entry for VNI %u not found at DEL",
+                                 bgp->vrf_id, vni);
                return 0;
        }
 
@@ -5529,9 +5532,9 @@ int bgp_evpn_local_es_del(struct bgp *bgp,
        /* Lookup ESI hash - should exist. */
        es = bgp_evpn_lookup_es(bgp, esi);
        if (!es) {
-               zlog_warn("%u: ESI hash entry for ESI %s at Local ES DEL",
-                         bgp->vrf_id,
-                         esi_to_str(esi, buf, sizeof(buf)));
+               flog_warn(BGP_WARN_EVPN_ESI,
+                         "%u: ESI hash entry for ESI %s at Local ES DEL",
+                         bgp->vrf_id, esi_to_str(esi, buf, sizeof(buf)));
                return -1;
        }