]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd, lib: Cleanup CI warnings from system
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 16 May 2018 12:17:53 +0000 (08:17 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 30 May 2018 11:48:21 +0000 (07:48 -0400)
Make the CI system happy.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd/bgp_ecommunity.c
bgpd/bgp_evpn.c
bgpd/bgp_evpn_private.h
bgpd/bgp_evpn_vty.c
bgpd/bgp_route.c
lib/prefix.c
lib/prefix.h
lib/zclient.h

index d00a8dc2ec1b59f84d0915117b9470f66e5aa910..8c5356c99804040af5bf71cd83fd65a73e512c76 100644 (file)
@@ -804,6 +804,7 @@ char *ecommunity_ecom2str(struct ecommunity *ecom, int format, int filter)
                        } else if (*pnt
                                   == ECOMMUNITY_EVPN_SUBTYPE_ES_IMPORT_RT) {
                                struct ethaddr mac;
+
                                pnt++;
                                memcpy(&mac, pnt, ETH_ALEN);
                                len = sprintf(
index f448df13e5cd9fb65b02a83c87fa0c340c190e46..991b70c9cab680c78f807c9c424b925b0772b75d 100644 (file)
@@ -955,8 +955,10 @@ static int is_vtep_present_in_list(struct list *list,
        return 0;
 }
 
-/* Best path for ES route was changed,
-   update the list of VTEPs for this ES */
+/*
+ * Best path for ES route was changed,
+ * update the list of VTEPs for this ES
+ */
 static int evpn_es_install_vtep(struct bgp *bgp,
                                struct evpnes *es,
                                struct prefix_evpn *p,
@@ -974,8 +976,10 @@ static int evpn_es_install_vtep(struct bgp *bgp,
        return 0;
 }
 
-/* Best path for ES route was changed,
-   update the list of VTEPs for this ES */
+/*
+ * Best path for ES route was changed,
+ * update the list of VTEPs for this ES
+ */
 static int evpn_es_uninstall_vtep(struct bgp *bgp,
                                  struct evpnes *es,
                                  struct prefix_evpn *p,
@@ -1017,7 +1021,8 @@ static int evpn_es_route_select_install(struct bgp *bgp,
        old_select = old_and_new.old;
        new_select = old_and_new.new;
 
-       /* If the best path hasn't changed - see if something needs to be
+       /*
+        * If the best path hasn't changed - see if something needs to be
         * updated
         */
        if (old_select && old_select == new_select
@@ -1039,7 +1044,8 @@ static int evpn_es_route_select_install(struct bgp *bgp,
        /* If the user did a "clear" this flag will be set */
        UNSET_FLAG(rn->flags, BGP_NODE_USER_CLEAR);
 
-       /* bestpath has changed; update relevant fields and install or uninstall
+       /*
+        * bestpath has changed; update relevant fields and install or uninstall
         * into the zebra RIB.
         */
        if (old_select || new_select)
@@ -1061,9 +1067,9 @@ static int evpn_es_route_select_install(struct bgp *bgp,
        } else {
                if (old_select && old_select->type == ZEBRA_ROUTE_BGP
                    && old_select->sub_type == BGP_ROUTE_IMPORTED)
-                       ret = evpn_es_uninstall_vtep(bgp, es,
-                                                    (struct prefix_evpn *)&rn->p,
-                                                    old_select->attr->nexthop);
+                       ret = evpn_es_uninstall_vtep(
+                               bgp, es, (struct prefix_evpn *)&rn->p,
+                               old_select->attr->nexthop);
        }
 
        /* Clear any route change flags. */
@@ -1411,8 +1417,9 @@ static int update_evpn_type5_route_entry(struct bgp *bgp_def,
                        local_ri = tmp_ri;
        }
 
-       /* create a new route entry if one doesnt exist.
-          Otherwise see if route attr has changed
+       /*
+        * create a new route entry if one doesnt exist.
+        * Otherwise see if route attr has changed
         */
        if (!local_ri) {
 
@@ -1798,7 +1805,7 @@ static int delete_evpn_type4_route(struct bgp *bgp,
         * Note: there is no RD here.
         */
        rn = bgp_node_lookup(es->route_table, (struct prefix *)p);
-       if (!rn )
+       if (!rn)
                return 0;
 
        /* Next, locate route node in the global EVPN routing table.
@@ -2810,7 +2817,8 @@ static int install_uninstall_routes_for_es(struct bgp *bgp,
        afi = AFI_L2VPN;
        safi = SAFI_EVPN;
 
-       /* Walk entire global routing table and evaluate routes which could be
+       /*
+        * Walk entire global routing table and evaluate routes which could be
         * imported into this VRF. Note that we need to loop through all global
         * routes to determine which route matches the import rt on vrf
         */
@@ -2824,8 +2832,8 @@ static int install_uninstall_routes_for_es(struct bgp *bgp,
                        struct prefix_evpn *evp = (struct prefix_evpn *)&rn->p;
 
                        for (ri = rn->info; ri; ri = ri->next) {
-
-                               /* Consider "valid" remote routes applicable for
+                               /*
+                                * Consider "valid" remote routes applicable for
                                 * this ES.
                                 */
                                if (!(CHECK_FLAG(ri->flags, BGP_INFO_VALID)
@@ -2833,28 +2841,26 @@ static int install_uninstall_routes_for_es(struct bgp *bgp,
                                      && ri->sub_type == BGP_ROUTE_NORMAL))
                                        continue;
 
-                               if (is_prefix_matching_for_es(evp, es)) {
-                                       if (install)
-                                               ret =
-                                                       install_evpn_route_entry_in_es(
-                                                       bgp, es, evp, ri);
-                                       else
-                                               ret =
-                                                       uninstall_evpn_route_entry_in_es(
-                                                       bgp, es, evp, ri);
+                               if (!is_prefix_matching_for_es(evp, es))
+                                       continue;
 
-                                       if (ret) {
-                                               zlog_err(
-                                                       "Failed to %s EVPN %s route in ESI %s",
-                                                       install ? "install"
-                                                               : "uninstall",
-                                                       prefix2str(evp, buf,
-                                                                  sizeof(buf)),
-                                                       esi_to_str(&es->esi,
-                                                                  buf1,
-                                                                  sizeof(buf1)));
-                                               return ret;
-                                       }
+                               if (install)
+                                       ret = install_evpn_route_entry_in_es(
+                                               bgp, es, evp, ri);
+                               else
+                                       ret = uninstall_evpn_route_entry_in_es(
+                                               bgp, es, evp, ri);
+
+                               if (ret) {
+                                       zlog_err(
+                                               "Failed to %s EVPN %s route in ESI %s",
+                                               install ? "install"
+                                                       : "uninstall",
+                                               prefix2str(evp, buf,
+                                                          sizeof(buf)),
+                                               esi_to_str(&es->esi, buf1,
+                                                          sizeof(buf1)));
+                                       return ret;
                                }
                        }
                }
@@ -3309,8 +3315,10 @@ static int install_uninstall_evpn_route(struct bgp *bgp, afi_t afi, safi_t safi,
        return 0;
 }
 
-/* delete and withdraw all ipv4 and ipv6 routes in the vrf table as type-5
- * routes */
+/*
+ * delete and withdraw all ipv4 and ipv6 routes in the vrf table as type-5
+ * routes
+ */
 static void delete_withdraw_vrf_routes(struct bgp *bgp_vrf)
 {
        /* delete all ipv4 routes and withdraw from peers */
@@ -3322,8 +3330,10 @@ static void delete_withdraw_vrf_routes(struct bgp *bgp_vrf)
                bgp_evpn_withdraw_type5_routes(bgp_vrf, AFI_IP6, SAFI_UNICAST);
 }
 
-/* update and advertise all ipv4 and ipv6 routes in thr vrf table as type-5
- * routes */
+/*
+ * update and advertise all ipv4 and ipv6 routes in thr vrf table as type-5
+ * routes
+ */
 static void update_advertise_vrf_routes(struct bgp *bgp_vrf)
 {
        /* update all ipv4 routes */
@@ -3776,8 +3786,7 @@ static int process_type4_route(struct peer *peer, afi_t afi, safi_t safi,
                ret = bgp_update(peer, (struct prefix *)&p, addpath_id, attr,
                                 afi, safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL,
                                 &prd, NULL, 0, 0, NULL);
-       }
-       else {
+       } else {
                ret = bgp_withdraw(peer, (struct prefix *)&p, addpath_id, attr,
                                   afi, safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL,
                                   &prd, NULL, 0, NULL);
@@ -4596,7 +4605,8 @@ void bgp_evpn_encode_prefix(struct stream *s, struct prefix *p,
                stream_put(s, prd->val, 8); /* RD */
                stream_put(s, evp->prefix.es_addr.esi.val, 10); /* ESI */
                stream_putc(s, IPV4_MAX_BITLEN); /* IP address Length - bits */
-               stream_put_in_addr(s, &evp->prefix.es_addr.ip.ipaddr_v4); /* VTEP IP*/
+               /* VTEP IP */
+               stream_put_in_addr(s, &evp->prefix.es_addr.ip.ipaddr_v4);
                break;
 
        case BGP_EVPN_IP_PREFIX_ROUTE:
@@ -5509,7 +5519,7 @@ int bgp_evpn_local_es_del(struct bgp *bgp,
        }
 
        /* Delete all local EVPN ES routes from ESI table
-         * and schedule for processing (to withdraw from peers))
+        * and schedule for processing (to withdraw from peers))
         */
        delete_routes_for_es(bgp, es);
 
@@ -5536,7 +5546,7 @@ int bgp_evpn_local_es_add(struct bgp *bgp,
        }
 
        /* create the new es */
-       es = bgp_evpn_lookup_es(bgp,esi);
+       es = bgp_evpn_lookup_es(bgp, esi);
        if (!es) {
                es = bgp_evpn_es_new(bgp, esi, originator_ip);
                if (!es) {
index bafe81b253756034757f89040fdcf4b96bc41560..bf6a24dea61e793a7cb16ff9b4640f3b0ad7c8d0 100644 (file)
@@ -106,8 +106,10 @@ struct evpnes {
 #define EVPNES_LOCAL   0x01
 #define EVPNES_REMOTE  0x02
 
-       /* Id for deriving the RD
-        * automatically for this ESI */
+       /*
+        * Id for deriving the RD
+        * automatically for this ESI
+        */
        uint16_t rd_id;
 
        /* RD for this VNI. */
@@ -119,8 +121,10 @@ struct evpnes {
        /* list of VTEPs in the same site */
        struct list *vtep_list;
 
-       /* Route table for EVPN routes for
-        * this ESI. - type4 routes */
+       /*
+        * Route table for EVPN routes for
+        * this ESI. - type4 routes
+        */
        struct bgp_table *route_table;
 
        QOBJ_FIELDS
@@ -440,8 +444,9 @@ static inline int evpn_default_originate_set(struct bgp *bgp, afi_t afi,
 static inline void es_get_system_mac(esi_t *esi,
                                     struct ethaddr *mac)
 {
-       /* for type-1 and type-3 ESIs,
-          the system mac starts at val[1]
+       /*
+        * for type-1 and type-3 ESIs,
+        * the system mac starts at val[1]
         */
        memcpy(mac, &esi->val[1], ETH_ALEN);
 }
index 2f4349b3252d254b8987f6af0a282b1b872fc80d..f87196426c1b4eda3c6c69a8a842e86434f5321e 100644 (file)
@@ -426,12 +426,14 @@ static void display_es(struct vty *vty, struct evpnes *es, json_object *json)
                json_object_string_add(json, "rd",
                                       prefix_rd2str(&es->prd, buf1,
                                                     sizeof(buf1)));
-               json_object_string_add(json,"originatorIp",
+               json_object_string_add(
+                       json, "originatorIp",
                        ipaddr2str(&es->originator_ip, buf2, sizeof(buf2)));
                if (es->vtep_list) {
                        for (ALL_LIST_ELEMENTS_RO(es->vtep_list, node, vtep))
-                               json_object_array_add(json_vteps,
-                                                     json_object_new_string(inet_ntoa(*vtep)));
+                               json_object_array_add(
+                                       json_vteps, json_object_new_string(
+                                                           inet_ntoa(*vtep)));
                }
                json_object_object_add(json, "vteps", json_vteps);
        } else {
@@ -444,7 +446,7 @@ static void display_es(struct vty *vty, struct evpnes *es, json_object *json)
                if (es->vtep_list) {
                        vty_out(vty, "  VTEP List:\n");
                        for (ALL_LIST_ELEMENTS_RO(es->vtep_list, node, vtep))
-                               vty_out(vty,"    %s\n", inet_ntoa(*vtep));
+                               vty_out(vty, "    %s\n", inet_ntoa(*vtep));
                }
        }
 }
@@ -850,7 +852,8 @@ static void show_es_entry(struct hash_backet *backet, void *args[])
                json_object_string_add(json, "rd",
                                       prefix_rd2str(&es->prd, buf1,
                                                     sizeof(buf1)));
-               json_object_string_add(json,"originatorIp",
+               json_object_string_add(
+                       json, "originatorIp",
                        ipaddr2str(&es->originator_ip, buf2, sizeof(buf2)));
                if (es->vtep_list) {
                        for (ALL_LIST_ELEMENTS_RO(es->vtep_list, node, vtep))
@@ -2518,7 +2521,8 @@ static void evpn_show_es(struct vty *vty, struct bgp *bgp, esi_t *esi,
 }
 
 /* Display all ESs */
-static void evpn_show_all_es(struct vty *vty, struct bgp *bgp, json_object *json)
+static void evpn_show_all_es(struct vty *vty, struct bgp *bgp,
+                            json_object *json)
 {
        void *args[2];
 
@@ -3917,7 +3921,7 @@ DEFUN(test_adv_evpn_type4_route,
                return CMD_WARNING;
        }
 
-       if(!str_to_esi(argv[2]->arg, &esi)) {
+       if (!str_to_esi(argv[2]->arg, &esi)) {
                vty_out(vty, "%%Malformed ESI\n");
                return CMD_WARNING;
        }
@@ -3956,7 +3960,7 @@ DEFUN(test_withdraw_evpn_type4_route,
                return CMD_WARNING;
        }
 
-       if(!str_to_esi(argv[2]->arg, &esi)) {
+       if (!str_to_esi(argv[2]->arg, &esi)) {
                vty_out(vty, "%%Malformed ESI\n");
                return CMD_WARNING;
        }
index ff103bb770055df33b6f5245b5e4b32082b52fa3..7de1d232724d53c7b1bd107a2cfaab6738342e49 100644 (file)
@@ -2106,17 +2106,18 @@ int bgp_zebra_has_route_changed(struct bgp_node *rn, struct bgp_info *selected)
 {
        struct bgp_info *mpinfo;
 
-       /* If this is multipath, check all selected paths for any nexthop change
-        * or attribute change. Some attribute changes (e.g., community) aren't of
-        * relevance to the RIB, but we'll update zebra to ensure we handle the
-        * case of BGP nexthop change. This is the behavior when the best path
-        * has an attribute change anyway.
+       /* If this is multipath, check all selected paths for any nexthop
+        * change or attribute change. Some attribute changes (e.g., community)
+        * aren't of relevance to the RIB, but we'll update zebra to ensure
+        * we handle the case of BGP nexthop change. This is the behavior
+        * when the best path has an attribute change anyway.
         */
        if (CHECK_FLAG(selected->flags, BGP_INFO_IGP_CHANGED)
            || CHECK_FLAG(selected->flags, BGP_INFO_MULTIPATH_CHG))
                return 1;
 
-       /* If this is multipath, check all selected paths for any nexthop change
+       /*
+        * If this is multipath, check all selected paths for any nexthop change
         */
        for (mpinfo = bgp_info_mpath_first(selected); mpinfo;
             mpinfo = bgp_info_mpath_next(mpinfo)) {
index 303b12e3a9b1fe00ff08434c2329037c0a35290c..ead5444fd0a3b558856d24d209b371d66cff477f 100644 (file)
@@ -432,6 +432,7 @@ static const struct in6_addr maskbytes6[] = {
 void prefix_hexdump(const struct prefix *p)
 {
        char buf[PREFIX_STRLEN];
+
        zlog_debug("prefix: %s",
                   prefix2str(p, buf, sizeof(buf)));
        zlog_hexdump(p, sizeof(struct prefix));
index fadaab18599a132edb199011791bf3aafccecd1e..f5dbb22f79282c51d00ee42f80e7a1eba5d3696b 100644 (file)
@@ -40,7 +40,7 @@
 #endif
 
 #define ESI_BYTES 10
-#define ESI_STR_LEN (3* ESI_BYTES)
+#define ESI_STR_LEN (3 * ESI_BYTES)
 
 #define ETHER_ADDR_STRLEN (3*ETH_ALEN)
 /*
index ceb4dc74f96231324e1b7b8974f7a28430dd999d..ad98b8db8776d39d7bd2f65839184e5dc4893f57 100644 (file)
@@ -239,8 +239,10 @@ struct zclient {
        int (*redistribute_route_del)(int, struct zclient *, uint16_t,
                                      vrf_id_t);
        int (*fec_update)(int, struct zclient *, uint16_t);
-       int (*local_es_add)(int, struct zclient *, uint16_t, vrf_id_t);
-       int (*local_es_del)(int, struct zclient *, uint16_t, vrf_id_t);
+       int (*local_es_add)(int command, struct zclient *zclient,
+                           uint16_t length, vrf_id_t vrf_id);
+       int (*local_es_del)(int command, struct zclient *zclient,
+                           uint16_t length, vrf_id_t vrf_id);
        int (*local_vni_add)(int, struct zclient *, uint16_t, vrf_id_t);
        int (*local_vni_del)(int, struct zclient *, uint16_t, vrf_id_t);
        int (*local_l3vni_add)(int, struct zclient *, uint16_t, vrf_id_t);