]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_flowspec.c
zebra: clang-format style fixes
[mirror_frr.git] / bgpd / bgp_flowspec.c
index 341cfe9d07e86985bfdcd6be74a1d91d908e7957..b07625c49e2395e17ceb32f34554eede598406ca 100644 (file)
@@ -103,7 +103,6 @@ int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr,
        safi_t safi;
        int psize = 0;
        struct prefix p;
-       int ret;
        void *temp;
 
        /* Start processing the NLRI - there may be multiple in the MP_REACH */
@@ -121,7 +120,7 @@ int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr,
 
        for (; pnt < lim; pnt += psize) {
                /* Clear prefix structure. */
-               memset(&p, 0, sizeof(struct prefix));
+               memset(&p, 0, sizeof(p));
 
                /* All FlowSpec NLRI begin with length. */
                if (pnt + 1 > lim)
@@ -170,9 +169,10 @@ int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr,
                                               afi);
                        snprintf(ec_string, sizeof(ec_string),
                                 "EC{none}");
-                       if (attr && attr->ecommunity) {
-                               s = ecommunity_ecom2str(attr->ecommunity,
-                                               ECOMMUNITY_FORMAT_ROUTE_MAP, 0);
+                       if (attr && bgp_attr_get_ecommunity(attr)) {
+                               s = ecommunity_ecom2str(
+                                       bgp_attr_get_ecommunity(attr),
+                                       ECOMMUNITY_FORMAT_ROUTE_MAP, 0);
                                snprintf(ec_string, sizeof(ec_string),
                                         "EC{%s}",
                                        s == NULL ? "none" : s);
@@ -189,21 +189,13 @@ int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr,
                }
                /* Process the route. */
                if (!withdraw)
-                       ret = bgp_update(peer, &p, 0, attr,
-                                        afi, safi,
-                                        ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL,
-                                        NULL, NULL, 0, 0, NULL);
+                       bgp_update(peer, &p, 0, attr, afi, safi,
+                                  ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, NULL,
+                                  NULL, 0, 0, NULL);
                else
-                       ret = bgp_withdraw(peer, &p, 0, attr,
-                                          afi, safi,
-                                          ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL,
-                                          NULL, NULL, 0, NULL);
-               if (ret) {
-                       flog_err(EC_BGP_FLOWSPEC_INSTALLATION,
-                                "Flowspec NLRI failed to be %s.",
-                                attr ? "added" : "withdrawn");
-                       return BGP_NLRI_PARSE_ERROR;
-               }
+                       bgp_withdraw(peer, &p, 0, attr, afi, safi,
+                                    ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, NULL,
+                                    NULL, 0, NULL);
        }
        return BGP_NLRI_PARSE_OK;
 }