]> git.puffer.fish Git - mirror/frr.git/commitdiff
staticd: remove checks that are no longer necessary
authorRenato Westphal <renato@opensourcerouting.org>
Thu, 10 Sep 2020 21:45:42 +0000 (18:45 -0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Tue, 6 Oct 2020 12:54:24 +0000 (15:54 +0300)
All call sites of static_route_leak() are passing a non-null pointer
to the 'vty' parameter, hence remove the 'vty' null checks that
are no longer necessary.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
staticd/static_vty.c

index 476340693442f669ad7251e00f13c12c25191ec4..9ebc134820f90bf04c2c09233712cf8e2ccdbace 100644 (file)
@@ -81,11 +81,7 @@ static int static_route_leak(struct vty *vty, const char *svrf,
 
        ret = str2prefix(dest_str, &p);
        if (ret <= 0) {
-               if (vty)
-                       vty_out(vty, "%% Malformed address\n");
-               else
-                       zlog_warn("%s: Malformed address: %s", __func__,
-                                 dest_str);
+               vty_out(vty, "%% Malformed address\n");
                return CMD_WARNING_CONFIG_FAILED;
        }
 
@@ -95,11 +91,7 @@ static int static_route_leak(struct vty *vty, const char *svrf,
                if (mask_str) {
                        ret = inet_aton(mask_str, &mask);
                        if (ret == 0) {
-                               if (vty)
-                                       vty_out(vty, "%% Malformed address\n");
-                               else
-                                       zlog_warn("%s: Malformed address: %s",
-                                                 __func__, mask_str);
+                               vty_out(vty, "%% Malformed address\n");
                                return CMD_WARNING_CONFIG_FAILED;
                        }
                        p.prefixlen = ip_masklen(mask);
@@ -110,13 +102,7 @@ static int static_route_leak(struct vty *vty, const char *svrf,
                if (src_str) {
                        ret = str2prefix(src_str, &src);
                        if (ret <= 0 || src.family != AF_INET6) {
-                               if (vty)
-                                       vty_out(vty,
-                                               "%% Malformed source address\n");
-                               else
-                                       zlog_warn(
-                                               "%s: Malformed source address: %s",
-                                               __func__, src_str);
+                               vty_out(vty, "%% Malformed source address\n");
                                return CMD_WARNING_CONFIG_FAILED;
                        }
                }