]> git.puffer.fish Git - mirror/frr.git/commitdiff
Fix coding style.
authorMitesh Kanjariya <mitesh@marvel-07.cumulusnetworks.com>
Sat, 19 Aug 2017 00:23:30 +0000 (17:23 -0700)
committerMitesh Kanjariya <mitesh@marvel-07.cumulusnetworks.com>
Sat, 19 Aug 2017 00:33:56 +0000 (17:33 -0700)
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
bgpd/bgp_evpn.c
bgpd/bgp_nht.c
bgpd/bgp_route.c
bgpd/bgp_vty.c
zebra/zebra_l2.c
zebra/zebra_vxlan.c

index ad000e3f12c1d5762e970240e0a666364a162f53..f509d869a37da53149f16cb7359d2c7a2db27f8e 100644 (file)
@@ -2191,8 +2191,7 @@ char *bgp_evpn_label2str(mpls_label_t *label, char *buf, int len)
  * Function to convert evpn route to json format.
  * NOTE: We don't use prefix2str as the output here is a bit different.
  */
-void
-bgp_evpn_route2json(struct prefix_evpn *p, json_object *json)
+void bgp_evpn_route2json(struct prefix_evpn *p, json_object *json)
 {
        char buf1[ETHER_ADDR_STRLEN];
        char buf2[PREFIX2STR_BUFFER];
@@ -2203,56 +2202,56 @@ bgp_evpn_route2json(struct prefix_evpn *p, json_object *json)
        if (p->prefix.route_type == BGP_EVPN_IMET_ROUTE) {
                json_object_int_add(json, "routeType", p->prefix.route_type);
                json_object_int_add(json, "ethTag", 0);
-               json_object_int_add(json,
-                                   "ipLen",
-                                   IS_EVPN_PREFIX_IPADDR_V4 (p) ?
-                                       IPV4_MAX_BITLEN : IPV6_MAX_BITLEN);
+               json_object_int_add(json, "ipLen",
+                                   IS_EVPN_PREFIX_IPADDR_V4(p)
+                                           ? IPV4_MAX_BITLEN
+                                           : IPV6_MAX_BITLEN);
                json_object_string_add(json, "ip",
-                                      inet_ntoa (p->prefix.ip.ipaddr_v4));
-       }
-       else if (p->prefix.route_type == BGP_EVPN_MAC_IP_ROUTE) {
+                                      inet_ntoa(p->prefix.ip.ipaddr_v4));
+       } else if (p->prefix.route_type == BGP_EVPN_MAC_IP_ROUTE) {
                if (IS_EVPN_PREFIX_IPADDR_NONE(p)) {
-                 json_object_int_add(json, "routeType", p->prefix.route_type);
-                 json_object_int_add(json, "esi", 0); /* TODO: we don't support esi yet */
-                 json_object_int_add(json, "ethTag", 0);
-                 json_object_int_add(json, "macLen", 8 * ETH_ALEN);
-                 json_object_string_add(json, "mac",
-                                        prefix_mac2str (&p->prefix.mac,
-                                                        buf1, sizeof (buf1)));
+                       json_object_int_add(json, "routeType",
+                                           p->prefix.route_type);
+                       json_object_int_add(
+                               json, "esi",
+                               0); /* TODO: we don't support esi yet */
+                       json_object_int_add(json, "ethTag", 0);
+                       json_object_int_add(json, "macLen", 8 * ETH_ALEN);
+                       json_object_string_add(json, "mac",
+                                              prefix_mac2str(&p->prefix.mac,
+                                                             buf1,
+                                                             sizeof(buf1)));
                } else {
                        u_char family;
 
-                       family = IS_EVPN_PREFIX_IPADDR_V4(p) ? \
-                          AF_INET : AF_INET6;
+                       family = IS_EVPN_PREFIX_IPADDR_V4(p) ? AF_INET
+                                                            : AF_INET6;
 
                        json_object_int_add(json, "routeType",
-                                            p->prefix.route_type);
-                       json_object_int_add(json, "esi", 0); /* TODO: we don't support esi yet */
+                                           p->prefix.route_type);
+                       json_object_int_add(
+                               json, "esi",
+                               0); /* TODO: we don't support esi yet */
                        json_object_int_add(json, "ethTag", 0);
-                       json_object_int_add(json, "macLen",
-                                           8 * ETH_ALEN);
+                       json_object_int_add(json, "macLen", 8 * ETH_ALEN);
                        json_object_string_add(json, "mac",
-                                              prefix_mac2str (&p->prefix.mac,
-                                                              buf1,
-                                                              sizeof (buf1)));
+                                              prefix_mac2str(&p->prefix.mac,
+                                                             buf1,
+                                                             sizeof(buf1)));
                        json_object_int_add(json, "ipLen",
-                                           IS_EVPN_PREFIX_IPADDR_V4 (p) ?
-                                               IPV4_MAX_BITLEN :
-                                               IPV6_MAX_BITLEN);
-                       json_object_string_add(json, "ip",
-                                              inet_ntop (family,
-                                                         &p->prefix.ip.ip.addr,
-                                                         buf2,
-                                                         PREFIX2STR_BUFFER));
+                                           IS_EVPN_PREFIX_IPADDR_V4(p)
+                                                   ? IPV4_MAX_BITLEN
+                                                   : IPV6_MAX_BITLEN);
+                       json_object_string_add(
+                               json, "ip",
+                               inet_ntop(family, &p->prefix.ip.ip.addr, buf2,
+                                         PREFIX2STR_BUFFER));
                }
        } else {
                /* Currently, this is to cater to other AF_ETHERNET code. */
        }
-
-  return;
 }
 
-
 /*
  * Function to convert evpn route to string.
  * NOTE: We don't use prefix2str as the output here is a bit different.
index 55a2f10132453a8b9cb982bcd7f15e7451497c55..a0fc10c745bbb6846f4ef1fd9770aa3339109ee2 100644 (file)
@@ -498,7 +498,8 @@ void bgp_cleanup_nexthops(struct bgp *bgp)
 
                for (rn = bgp_table_top(bgp->nexthop_cache_table[afi]); rn;
                     rn = bgp_route_next(rn)) {
-                       if ((bnc = rn->info) == NULL)
+                       bnc = rn->info;
+                       if (!bnc)
                                continue;
 
                        /* Clear relevant flags. */
index a2a7d2ae1d424028ab2b5da148cbdd2309d07195..428b4f3626252533eea373d2dd7103afa6f7e71c 100644 (file)
@@ -6262,12 +6262,12 @@ static void route_vty_out_route(struct prefix *p, struct vty *vty,
                len = vty_out(vty, "%s", buf);
        } else if (p->family == AF_EVPN) {
 #if defined(HAVE_CUMULUS)
-       if (!json)
-               len = vty_out(vty, "%s",
-                             bgp_evpn_route2str((struct prefix_evpn *)p,
-                                                buf, BUFSIZ));
-       else
-               bgp_evpn_route2json((struct prefix_evpn *) p, json);
+               if (!json)
+                       len = vty_out(vty, "%s",
+                               bgp_evpn_route2str((struct prefix_evpn *)p,
+                                                  buf, BUFSIZ));
+               else
+                       bgp_evpn_route2json((struct prefix_evpn *) p, json);
 #else
                prefix2str(p, buf, PREFIX_STRLEN);
                len = vty_out(vty, "%s", buf);
index 5d44c0a1428484654915224f09956a338afad902..60361adbb6b6254374a6445ea68d3a796f6c1fb5 100644 (file)
@@ -9040,7 +9040,8 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, u_char use_json,
                                        "    Hostname Capability:");
 
                                if (CHECK_FLAG(p->cap, PEER_CAP_HOSTNAME_ADV)) {
-                                       vty_out(vty, " advertised (name: %s,domain name: %s)",
+                                       vty_out(vty,
+                                               " advertised (name: %s,domain name: %s)",
                                                bgp->peer_self->hostname ?
                                                        bgp->peer_self->hostname
                                                        : "n/a",
@@ -9052,7 +9053,8 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, u_char use_json,
                                }
 
                                if (CHECK_FLAG(p->cap, PEER_CAP_HOSTNAME_RCV)) {
-                                       vty_out(vty, " received (name: %s,domain name: %s)",
+                                       vty_out(vty,
+                                               " received (name: %s,domain name: %s)",
                                                p->hostname ?
                                                        p->hostname : "n/a",
                                                p->domainname ?
index 7281622e3333048e31108363773aeb1a211fbe2d..3d505857c271dc0a1c8165afaa2261c5ed41ff89 100644 (file)
@@ -230,9 +230,10 @@ void zebra_l2if_update_bridge_slave(struct interface *ifp,
                if (zif->zif_type == ZEBRA_IF_VXLAN)
                        zebra_vxlan_if_update(ifp, ZEBRA_VXLIF_MASTER_CHANGE);
        } else if (old_bridge_ifindex != IFINDEX_INTERNAL) {
-               /* In the case of VxLAN, invoke the handler for EVPN.
-                * Note that this should be done *prior* to unmapping the interface
-                * from the bridge.
+               /*
+                * In the case of VxLAN, invoke the handler for EVPN.
+                * Note that this should be done *prior*
+                * to unmapping the interface from the bridge.
                 */
                if (zif->zif_type == ZEBRA_IF_VXLAN)
                        zebra_vxlan_if_update(ifp, ZEBRA_VXLIF_MASTER_CHANGE);
index 6bf33806b8e08f7fdcc3f317917c4586b8600df5..c2ea8ab58c4212c728d3adba799dc9d39908e461 100644 (file)
@@ -2950,30 +2950,30 @@ int zebra_vxlan_local_neigh_add_update(struct interface *ifp,
                                 */
                                n->ifindex = ifp->ifindex;
                                return 0;
-                       } else {
-                               /* If the MAC has changed,
-                                * need to issue a delete first
-                                * as this means a different MACIP route.
-                                * Also, need to do some unlinking/relinking.
-                                */
-                               zvni_neigh_send_del_to_client(zvrf, zvni->vni,
-                                                             &n->ip, &n->emac,
-                                                             0);
-                               old_zmac = zvni_mac_lookup(zvni, &n->emac);
-                               if (old_zmac) {
-                                       listnode_delete(old_zmac->neigh_list,
-                                                       n);
-                                       zvni_deref_ip2mac(zvni, old_zmac, 0);
-                               }
-
-                               /* Set "local" forwarding info. */
-                               SET_FLAG(n->flags, ZEBRA_NEIGH_LOCAL);
-                               n->ifindex = ifp->ifindex;
-                               memcpy(&n->emac, macaddr, ETH_ALEN);
+                       }
 
-                               /* Link to new MAC */
-                               listnode_add_sort(zmac->neigh_list, n);
+                       /* If the MAC has changed,
+                        * need to issue a delete first
+                        * as this means a different MACIP route.
+                        * Also, need to do some unlinking/relinking.
+                        */
+                       zvni_neigh_send_del_to_client(zvrf, zvni->vni,
+                                                     &n->ip, &n->emac,
+                                                     0);
+                       old_zmac = zvni_mac_lookup(zvni, &n->emac);
+                       if (old_zmac) {
+                               listnode_delete(old_zmac->neigh_list,
+                                               n);
+                               zvni_deref_ip2mac(zvni, old_zmac, 0);
                        }
+
+                       /* Set "local" forwarding info. */
+                       SET_FLAG(n->flags, ZEBRA_NEIGH_LOCAL);
+                       n->ifindex = ifp->ifindex;
+                       memcpy(&n->emac, macaddr, ETH_ALEN);
+
+                       /* Link to new MAC */
+                       listnode_add_sort(zmac->neigh_list, n);
                } else if (ext_learned)
                /* The neighbor is remote and that is the notification we got.
                   */