]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: fix strange indentation
authorMark Stapp <mjs@voltanet.io>
Tue, 20 Oct 2020 18:04:48 +0000 (14:04 -0400)
committerMark Stapp <mjs@voltanet.io>
Tue, 27 Oct 2020 16:03:41 +0000 (12:03 -0400)
Fix some odd indentation in rt_netlink.c - merge damage, maybe?

Signed-off-by: Mark Stapp <mjs@voltanet.io>
zebra/rt_netlink.c

index da0eeb364e13a5628435a6d234d897e8c28814d3..19fe7b518028aeff0ab946e36d52cc1c35b9a172 100644 (file)
@@ -2097,6 +2097,8 @@ ssize_t netlink_nexthop_msg_encode(uint16_t cmd,
        int num_labels = 0;
        uint32_t id = dplane_ctx_get_nhe_id(ctx);
        int type = dplane_ctx_get_nhe_type(ctx);
+       struct rtattr *nest;
+       uint16_t encap;
 
        if (!id) {
                flog_err(
@@ -2225,34 +2227,21 @@ ssize_t netlink_nexthop_msg_encode(uint16_t cmd,
                                 */
                                if (req->nhm.nh_family == AF_MPLS)
                                        goto nexthop_done;
-#if 0
-                                       if (!nl_attr_put(&req->n, buflen, NHA_NEWDST,
-                                                 &out_lse,
-                                                 num_labels
-                                                         * sizeof(mpls_lse_t)))
-                                               return 0;
-#endif
-                               else {
-                                       struct rtattr *nest;
-                                       uint16_t encap = LWTUNNEL_ENCAP_MPLS;
-
-                                       if (!nl_attr_put16(&req->n, buflen,
-                                                          NHA_ENCAP_TYPE,
-                                                          encap))
-                                               return 0;
-                                       nest = nl_attr_nest(&req->n, buflen,
-                                                           NHA_ENCAP);
-                                       if (!nest)
-                                               return 0;
-                                       if (!nl_attr_put(
-                                                   &req->n, buflen,
-                                                   MPLS_IPTUNNEL_DST, &out_lse,
-                                                   num_labels
-                                                           * sizeof(
-                                                                   mpls_lse_t)))
-                                               return 0;
-                                       nl_attr_nest_end(&req->n, nest);
-                               }
+
+                               encap = LWTUNNEL_ENCAP_MPLS;
+                               if (!nl_attr_put16(&req->n, buflen,
+                                                  NHA_ENCAP_TYPE, encap))
+                                       return 0;
+                               nest = nl_attr_nest(&req->n, buflen, NHA_ENCAP);
+                               if (!nest)
+                                       return 0;
+                               if (!nl_attr_put(
+                                           &req->n, buflen, MPLS_IPTUNNEL_DST,
+                                           &out_lse,
+                                           num_labels * sizeof(mpls_lse_t)))
+                                       return 0;
+
+                               nl_attr_nest_end(&req->n, nest);
                        }
 
 nexthop_done:
@@ -2262,9 +2251,9 @@ nexthop_done:
                                           __func__, id, nh, nh->ifindex,
                                           vrf_id_to_name(nh->vrf_id),
                                           nh->vrf_id, label_buf);
-}
+               }
 
-req->nhm.nh_protocol = zebra2proto(type);
+               req->nhm.nh_protocol = zebra2proto(type);
 
        } else if (cmd != RTM_DELNEXTHOP) {
                flog_err(