]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Remove unused return codes in zebra_mpls.c
authorDonald Sharp <sharpd@nvidia.com>
Tue, 9 Aug 2022 18:12:15 +0000 (14:12 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Wed, 10 Aug 2022 11:15:31 +0000 (07:15 -0400)
There are some return codes for functions that
are not really used.  Clean them up.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
zebra/zapi_msg.c
zebra/zebra_mpls.c
zebra/zebra_mpls.h

index 98959430167c1ac3b90d0ee975fc84014bcc524e..a578395ef8cf2bda46113663164830a47e4e35b8 100644 (file)
@@ -2492,7 +2492,6 @@ static void zread_mpls_labels_add(ZAPI_HANDLER_ARGS)
 {
        struct stream *s;
        struct zapi_labels zl;
-       int ret;
 
        /* Get input stream.  */
        s = msg;
@@ -2510,12 +2509,7 @@ static void zread_mpls_labels_add(ZAPI_HANDLER_ARGS)
        if (zapi_labels_validate(&zl) < 0)
                return;
 
-       ret = mpls_zapi_labels_process(true, zvrf, &zl);
-       if (ret < 0) {
-               if (IS_ZEBRA_DEBUG_RECV)
-                       zlog_debug("%s: Error processing zapi request",
-                                  __func__);
-       }
+       mpls_zapi_labels_process(true, zvrf, &zl);
 }
 
 /*
@@ -2532,7 +2526,6 @@ static void zread_mpls_labels_delete(ZAPI_HANDLER_ARGS)
 {
        struct stream *s;
        struct zapi_labels zl;
-       int ret;
 
        /* Get input stream.  */
        s = msg;
@@ -2547,12 +2540,7 @@ static void zread_mpls_labels_delete(ZAPI_HANDLER_ARGS)
                return;
 
        if (zl.nexthop_num > 0) {
-               ret = mpls_zapi_labels_process(false /*delete*/, zvrf, &zl);
-               if (ret < 0) {
-                       if (IS_ZEBRA_DEBUG_RECV)
-                               zlog_debug("%s: Error processing zapi request",
-                                          __func__);
-               }
+               mpls_zapi_labels_process(false /*delete*/, zvrf, &zl);
        } else {
                mpls_lsp_uninstall_all_vrf(zvrf, zl.type, zl.local_label);
 
index ade381e27f6a75cdd05da526d7a2cb9693a0e386..3010a516b964390b40ba12f1ff0702a7649b7dec 100644 (file)
@@ -2747,9 +2747,9 @@ static bool ftn_update_nexthop(bool add_p, struct nexthop *nexthop,
        return true;
 }
 
-int mpls_ftn_uninstall(struct zebra_vrf *zvrf, enum lsp_types_t type,
-                      struct prefix *prefix, uint8_t route_type,
-                      unsigned short route_instance)
+void mpls_ftn_uninstall(struct zebra_vrf *zvrf, enum lsp_types_t type,
+                       struct prefix *prefix, uint8_t route_type,
+                       unsigned short route_instance)
 {
        struct route_table *table;
        struct route_node *rn;
@@ -2761,7 +2761,7 @@ int mpls_ftn_uninstall(struct zebra_vrf *zvrf, enum lsp_types_t type,
        /* Lookup table.  */
        table = zebra_vrf_table(afi, SAFI_UNICAST, zvrf_id(zvrf));
        if (!table)
-               return -1;
+               return;
 
        /* Lookup existing route */
        rn = route_node_get(table, prefix);
@@ -2772,7 +2772,7 @@ int mpls_ftn_uninstall(struct zebra_vrf *zvrf, enum lsp_types_t type,
                        break;
        }
        if (re == NULL)
-               return -1;
+               return;
 
        /*
         * Nexthops are now shared by multiple routes, so we have to make
@@ -2801,8 +2801,6 @@ int mpls_ftn_uninstall(struct zebra_vrf *zvrf, enum lsp_types_t type,
        zebra_nhg_free(new_nhe);
 
        rib_queue_add(rn);
-
-       return 0;
 }
 
 /*
@@ -2884,8 +2882,8 @@ static bool ftn_update_znh(bool add_p, enum lsp_types_t type,
  * There are several changes that need to be made, in several zebra
  * data structures, so we want to do all the work required at once.
  */
-int mpls_zapi_labels_process(bool add_p, struct zebra_vrf *zvrf,
-                            const struct zapi_labels *zl)
+void mpls_zapi_labels_process(bool add_p, struct zebra_vrf *zvrf,
+                             const struct zapi_labels *zl)
 {
        int i, counter, ret = 0;
        char buf[NEXTHOP_STRLEN];
@@ -2906,7 +2904,7 @@ int mpls_zapi_labels_process(bool add_p, struct zebra_vrf *zvrf,
                /* Lookup table. */
                lsp_table = zvrf->lsp_table;
                if (!lsp_table)
-                       return -1;
+                       return;
 
                /* Find or create LSP object */
                tmp_ile.in_label = zl->local_label;
@@ -3070,8 +3068,6 @@ znh_done:
 
        if (new_nhe)
                zebra_nhg_free(new_nhe);
-
-       return ret;
 }
 
 /*
index a7a955a80b60c9abeb1281baeb12dcb26bf6b288..a114f01339c13c8e8fe1d9fd416f71fc63861f36 100644 (file)
@@ -261,15 +261,15 @@ void zebra_mpls_print_fec(struct vty *vty, struct zebra_vrf *zvrf,
  * Handle zapi request to install/uninstall LSP and
  * (optionally) FEC-To-NHLFE (FTN) bindings.
  */
-int mpls_zapi_labels_process(bool add_p, struct zebra_vrf *zvrf,
-                            const struct zapi_labels *zl);
+void mpls_zapi_labels_process(bool add_p, struct zebra_vrf *zvrf,
+                             const struct zapi_labels *zl);
 
 /*
  * Uninstall all NHLFEs bound to a single FEC.
  */
-int mpls_ftn_uninstall(struct zebra_vrf *zvrf, enum lsp_types_t type,
-                      struct prefix *prefix, uint8_t route_type,
-                      unsigned short route_instance);
+void mpls_ftn_uninstall(struct zebra_vrf *zvrf, enum lsp_types_t type,
+                       struct prefix *prefix, uint8_t route_type,
+                       unsigned short route_instance);
 
 /*
  * Install/update a NHLFE for an LSP in the forwarding table. This may be