]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: fix some formatting/style issues
authorRafael Zalamena <rzalamena@opensourcerouting.org>
Mon, 10 Feb 2020 21:40:43 +0000 (18:40 -0300)
committerRafael Zalamena <rzalamena@opensourcerouting.org>
Tue, 14 Apr 2020 17:05:52 +0000 (14:05 -0300)
* Break lines longer than 80 columns.
* Remove space after '('.
* Use '%pIX' instead of 'inet_ntop'.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
zebra/dplane_fpm_nl.c
zebra/rt_netlink.c

index 4b8948b71ca5c33a18985eec6931d44966d993d9..f035b3b1c6d70ad1b6053783e73672ca9f2a23c1 100644 (file)
@@ -308,15 +308,19 @@ DEFUN(fpm_show_counters_json, fpm_show_counters_json_cmd,
        json_object_int_add(jo, "bytes-sent", gfnc->counters.bytes_sent);
        json_object_int_add(jo, "obuf-bytes", gfnc->counters.obuf_bytes);
        json_object_int_add(jo, "obuf-bytes-peak", gfnc->counters.obuf_peak);
-       json_object_int_add(jo, "connection-closes", gfnc->counters.connection_closes);
-       json_object_int_add(jo, "connection-errors", gfnc->counters.connection_errors);
-       json_object_int_add(jo, "data-plane-contexts", gfnc->counters.dplane_contexts);
+       json_object_int_add(jo, "connection-closes",
+                           gfnc->counters.connection_closes);
+       json_object_int_add(jo, "connection-errors",
+                           gfnc->counters.connection_errors);
+       json_object_int_add(jo, "data-plane-contexts",
+                           gfnc->counters.dplane_contexts);
        json_object_int_add(jo, "data-plane-contexts-queue",
                            gfnc->counters.ctxqueue_len);
        json_object_int_add(jo, "data-plane-contexts-queue-peak",
                            gfnc->counters.ctxqueue_len_peak);
        json_object_int_add(jo, "buffer-full-hits", gfnc->counters.buffer_full);
-       json_object_int_add(jo, "user-configures", gfnc->counters.user_configures);
+       json_object_int_add(jo, "user-configures",
+                           gfnc->counters.user_configures);
        json_object_int_add(jo, "user-disables", gfnc->counters.user_disables);
        vty_out(vty, "%s\n", json_object_to_json_string_ext(jo, 0));
        json_object_free(jo);
@@ -762,14 +766,12 @@ static int fpm_rib_send(struct thread *t)
                for (rn = route_top(rt); rn; rn = srcdest_route_next(rn)) {
                        dest = rib_dest_from_rnode(rn);
                        /* Skip bad route entries. */
-                       if (dest == NULL || dest->selected_fib == NULL) {
+                       if (dest == NULL || dest->selected_fib == NULL)
                                continue;
-                       }
 
                        /* Check for already sent routes. */
-                       if (CHECK_FLAG(dest->flags, RIB_DEST_UPDATE_FPM)) {
+                       if (CHECK_FLAG(dest->flags, RIB_DEST_UPDATE_FPM))
                                continue;
-                       }
 
                        /* Enqueue route install. */
                        dplane_ctx_reset(ctx);
index 7ca4425dc81a1097468cf614c0c169cfe572b2b0..c4af082e7240bc97dfea085cd007a6678741f9aa 100644 (file)
@@ -1290,7 +1290,6 @@ _netlink_route_build_multipath(const struct prefix *p, const char *routedesc,
        char label_buf[256];
        int num_labels = 0;
        struct vrf *vrf;
-       char addrstr[INET6_ADDRSTRLEN];
 
        rtnh->rtnh_len = sizeof(*rtnh);
        rtnh->rtnh_flags = 0;
@@ -1377,14 +1376,11 @@ _netlink_route_build_multipath(const struct prefix *p, const char *routedesc,
                else if (nexthop->src.ipv4.s_addr != INADDR_ANY)
                        *src = &nexthop->src;
 
-               if (IS_ZEBRA_DEBUG_KERNEL) {
-                       inet_ntop(AF_INET, &nexthop->gate.ipv4, addrstr,
-                                 sizeof(addrstr));
-                       zlog_debug( "%s: (%s): %pFX nexthop via %s %s if %u vrf %s(%u)",
-                                  __func__, routedesc, p, addrstr, label_buf,
-                                  nexthop->ifindex, VRF_LOGNAME(vrf),
-                                  nexthop->vrf_id);
-               }
+               if (IS_ZEBRA_DEBUG_KERNEL)
+                       zlog_debug("%s: (%s): %pFX nexthop via %pI4 %s if %u vrf %s(%u)",
+                                  __func__, routedesc, p, &nexthop->gate.ipv4,
+                                  label_buf, nexthop->ifindex,
+                                  VRF_LOGNAME(vrf), nexthop->vrf_id);
        }
        if (nexthop->type == NEXTHOP_TYPE_IPV6
            || nexthop->type == NEXTHOP_TYPE_IPV6_IFINDEX) {
@@ -1397,14 +1393,11 @@ _netlink_route_build_multipath(const struct prefix *p, const char *routedesc,
                else if (!IN6_IS_ADDR_UNSPECIFIED(&nexthop->src.ipv6))
                        *src = &nexthop->src;
 
-               if (IS_ZEBRA_DEBUG_KERNEL) {
-                       inet_ntop(AF_INET, &nexthop->gate.ipv6, addrstr,
-                                 sizeof(addrstr));
-                       zlog_debug( "%s: (%s): %pFX nexthop via %s %s if %u vrf %s(%u)",
-                                  __func__, routedesc, p, addrstr, label_buf,
-                                  nexthop->ifindex, VRF_LOGNAME(vrf),
-                                  nexthop->vrf_id);
-               }
+               if (IS_ZEBRA_DEBUG_KERNEL)
+                       zlog_debug("%s: (%s): %pFX nexthop via %pI6 %s if %u vrf %s(%u)",
+                                  __func__, routedesc, p, &nexthop->gate.ipv6,
+                                  label_buf, nexthop->ifindex,
+                                  VRF_LOGNAME(vrf), nexthop->vrf_id);
        }
 
        /*