From: Donald Sharp Date: Tue, 9 Aug 2022 18:12:15 +0000 (-0400) Subject: zebra: Remove unused return codes in zebra_mpls.c X-Git-Tag: base_8.4~145^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=1548fbbc449583c6db859982d86fa2d30e6f66a4;p=matthieu%2Ffrr.git zebra: Remove unused return codes in zebra_mpls.c There are some return codes for functions that are not really used. Clean them up. Signed-off-by: Donald Sharp --- diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index 9895943016..a578395ef8 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -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); diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c index ade381e27f..3010a516b9 100644 --- a/zebra/zebra_mpls.c +++ b/zebra/zebra_mpls.c @@ -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; } /* diff --git a/zebra/zebra_mpls.h b/zebra/zebra_mpls.h index a7a955a80b..a114f01339 100644 --- a/zebra/zebra_mpls.h +++ b/zebra/zebra_mpls.h @@ -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