]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Having one goto in a function to just return is silly
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 15 Jan 2019 12:26:00 +0000 (07:26 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 26 Jan 2019 01:14:38 +0000 (20:14 -0500)
Just return right there, goto's are useful if you have common
code that needs to be cleaned up before exiting this function,
of which this function has none and there is only one goto.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/rt_socket.c

index abcff22b6b183f315370370bdcd4629ad3c9ad7d..9cc2efb3e9fe1cb01fcb3d3558dc9deb6137cbb1 100644 (file)
@@ -308,8 +308,7 @@ enum zebra_dplane_result kernel_route_update(struct zebra_dplane_ctx *ctx)
 
        if (dplane_ctx_get_src(ctx) != NULL) {
                zlog_err("route add: IPv6 sourcedest routes unsupported!");
-               res = ZEBRA_DPLANE_REQUEST_FAILURE;
-               goto done;
+               return ZEBRA_DPLANE_REQUEST_FAILURE;
        }
 
        frr_elevate_privs(&zserv_privs) {
@@ -341,8 +340,6 @@ enum zebra_dplane_result kernel_route_update(struct zebra_dplane_ctx *ctx)
                }
        } /* Elevated privs */
 
-done:
-
        return res;
 }