]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: fun with whitespace conventions
authorLou Berger <lberger@labn.net>
Fri, 3 Nov 2017 21:36:06 +0000 (17:36 -0400)
committerLou Berger <lberger@labn.net>
Tue, 7 Nov 2017 17:05:09 +0000 (12:05 -0500)
Signed-off-by: Lou Berger <lberger@labn.net>
bgpd/bgp_attr.c
bgpd/bgp_route.c
bgpd/rfapi/bgp_rfapi_cfg.c
bgpd/rfapi/rfapi_vty.c
bgpd/rfapi/vnc_export_bgp.c

index e5f85f73953efcc26b458d22ca30c607e26be7ca..83ffcc5558c9b0064bde1df758848c87e6f135bf 100644 (file)
@@ -1638,7 +1638,10 @@ int bgp_mp_reach_parse(struct bgp_attr_parser_args *args,
        case BGP_ATTR_NHLEN_VPNV4:
                stream_getl(s); /* RD high */
                stream_getl(s); /* RD low */
-               /* NOTE: intentional fall through - for consistency in rx processing */
+               /*
+                * NOTE: intentional fall through
+                * - for consistency in rx processing
+                */
        case BGP_ATTR_NHLEN_IPV4:
                stream_get(&attr->mp_nexthop_global_in, s, IPV4_MAX_BYTELEN);
                /* Probably needed for RFC 2283 */
index 2753295f472c07569177c9494e3f7ad1567ab3f5..4ee1aafbe9f375f7b27e8d1de80280ba7449ea2a 100644 (file)
@@ -2788,7 +2788,7 @@ int bgp_update(struct peer *peer, struct prefix *p, u_int32_t addpath_id,
        }
 
        /* next hop check.  */
-       if (!CHECK_FLAG(peer->flags, PEER_FLAG_IS_RFAPI_HD) && /* allow vpn->vrf import */
+       if (!CHECK_FLAG(peer->flags, PEER_FLAG_IS_RFAPI_HD) &&
            bgp_update_martian_nexthop(bgp, afi, safi, &new_attr)) {
                reason = "martian or self next-hop;";
                bgp_attr_flush(&new_attr);
index b1899ec6aec34ae799a178494da634f50a450cc5..3ecc4be94eba2f683c496e4a0127aae2d19d9a13 100644 (file)
@@ -1752,7 +1752,7 @@ DEFUN (vnc_nve_group_export_no_routemap,
                is_bgp = 0;
                /* fall thru */
        case 'b':
-               idx +=2;
+               idx += 2;
                break;
        default:                /* route-map */
                idx++;
index 953ea739dc4d764475cb2d07c9393f22c5d902e4..6af99278bce3de085e9b664b2e4ebbb8e7b2dfd3 100644 (file)
@@ -4634,10 +4634,10 @@ notcfg:
  ************************************************************************/
 void vnc_add_vrf_opener(struct bgp *bgp, struct rfapi_nve_group_cfg *rfg)
 {
-       if (rfg->rfd == NULL) /* need new rfapi_handle */
-       {
+       if (rfg->rfd == NULL) { /* need new rfapi_handle */
                /* based on rfapi_open */
                struct rfapi_descriptor *rfd;
+
                rfd = XCALLOC(MTYPE_RFAPI_DESC,
                              sizeof(struct rfapi_descriptor));
                rfd->bgp = bgp;
index 268adcbfde72a805a9a071546b8d850e99b348f7..b348c399bfc15a320fdedd111c0331297bc4b947 100644 (file)
@@ -779,7 +779,11 @@ void vnc_direct_bgp_add_prefix(struct bgp *bgp,
                if (rfgn->rfg->type == RFAPI_GROUP_CFG_VRF) {
                        vnc_direct_add_rn_group_rd(bgp, rfgn->rfg, rn, &attr,
                                                   afi, rfgn->rfg->rfd);
-                       continue; /* yuck! - but consistent with rest of function */
+                       /*
+                        * yuck!
+                        *  - but consistent with rest of function
+                        */
+                       continue;
                }
                /*
                 * For each NVE that is assigned to the export nve group,
@@ -880,7 +884,11 @@ void vnc_direct_bgp_del_prefix(struct bgp *bgp,
                                     BGP_ROUTE_REDISTRIBUTE,
                                     NULL,      /* RD not used for unicast */
                                     NULL, NULL); /* tag not used for unicast */
-                       continue; /* yuck! - but consistent with rest of function */
+                       /*
+                        * yuck!
+                        *  - but consistent with rest of function
+                        */
+                       continue;
                }
                /*
                 * For each NVE that is assigned to the export nve group,
@@ -1161,7 +1169,7 @@ static void vnc_direct_add_rn_group_rd(struct bgp *bgp,
        if (irfd == NULL && rfg->type != RFAPI_GROUP_CFG_VRF) {
                /* need new rfapi_handle, for peer strcture
                 * -- based on vnc_add_vrf_prefi */
-               assert (rfg->rfd == NULL);
+               assert(rfg->rfd == NULL);
 
                if (!rfg->rt_export_list || !rfg->rfapi_import_table) {
                        vnc_zlog_debug_verbose("%s: VRF \"%s\" is missing RT import/export configuration.\n",
@@ -1183,8 +1191,10 @@ static void vnc_direct_add_rn_group_rd(struct bgp *bgp,
                              sizeof(struct rfapi_descriptor));
                irfd->bgp = bgp;
                rfg->rfd = irfd;
-               /* leave most fields empty as will get from (dynamic) config
-                * when needed */
+               /*
+                * leave most fields empty as will get from (dynamic) config
+                * when needed
+                */
                irfd->default_tunneltype_option.type = BGP_ENCAP_TYPE_MPLS;
                irfd->cookie = rfg;
                if (rfg->vn_prefix.family
@@ -1224,23 +1234,21 @@ static void vnc_direct_add_rn_group_rd(struct bgp *bgp,
 
        if (rfg->routemap_export_bgp) {
                route_map_result_t ret;
+
                info.peer = irfd->peer;
                info.attr = &hattr;
-               ret = route_map_apply(
-                                     rfg->routemap_export_bgp,
+               ret = route_map_apply(rfg->routemap_export_bgp,
                                      &rn->p, RMAP_BGP, &info);
                if (ret == RMAP_DENYMATCH) {
                        bgp_attr_flush(&hattr);
-                       vnc_zlog_debug_verbose(
-                                              "%s: route map says DENY, so not calling bgp_update",
+                       vnc_zlog_debug_verbose("%s: route map says DENY, so not calling bgp_update",
                                               __func__);
                        return;
                }
        }
 
        if (VNC_DEBUG(EXPORT_BGP_DIRECT_ADD)) {
-               vnc_zlog_debug_any(
-                                  "%s: hattr after route_map_apply:",
+               vnc_zlog_debug_any("%s: hattr after route_map_apply:",
                                   __func__);
                rfapiPrintAttrPtrs(NULL, &hattr);
        }
@@ -1321,7 +1329,11 @@ static void vnc_direct_bgp_add_group_afi(struct bgp *bgp,
                        if (rfg->type == RFAPI_GROUP_CFG_VRF) {
                                vnc_direct_add_rn_group_rd(bgp, rfg, rn, &attr,
                                                           afi, rfg->rfd);
-                               continue; /* yuck! - but consistent with rest of function */
+                               /*
+                                * yuck!
+                                *  - but consistent with rest of function
+                                */
+                               continue;
                        }
                        /*
                         * For each NVE that is assigned to the export nve
@@ -1331,7 +1343,7 @@ static void vnc_direct_bgp_add_group_afi(struct bgp *bgp,
                        for (ln = listhead(rfg->nves); ln;
                             ln = listnextnode(ln)) {
                                vnc_direct_add_rn_group_rd(bgp, rfg, rn, &attr,
-                                                          afi, listgetdata(ln));
+                                                  afi, listgetdata(ln));
                        }
                }
        }
@@ -1418,12 +1430,11 @@ static void vnc_direct_bgp_del_group_afi(struct bgp *bgp,
                                for (ln = listhead(rfg->nves); ln;
                                     ln = listnextnode(ln))
                                        vnc_direct_del_rn_group_rd(bgp, rfg, rn,
-                                                                  afi, listgetdata(ln));
+                                               afi, listgetdata(ln));
                        }
                }
 }
 
-
 /*
  * Caller is responsible for ensuring that the specified nve-group
  * was actually part of the list of exported nve groups.