From: Renato Westphal Date: Thu, 10 Sep 2020 21:45:42 +0000 (-0300) Subject: staticd: remove checks that are no longer necessary X-Git-Tag: frr-7.5~11^2~73 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=4e57880eb5cb46179c6b7c492505d3a761a70ba0;p=mirror%2Ffrr.git staticd: remove checks that are no longer necessary 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 --- diff --git a/staticd/static_vty.c b/staticd/static_vty.c index 4763406934..9ebc134820 100644 --- a/staticd/static_vty.c +++ b/staticd/static_vty.c @@ -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; } }