summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2020-09-10 23:45:42 +0200
committerRenato Westphal <renato@opensourcerouting.org>2020-09-11 20:13:22 +0200
commit406537cb703c652ec275ae7e824efb2009634837 (patch)
treee1303eaf582a319f3df5def04398b7748a6b5ddc
parentMerge pull request #7075 from donaldsharp/snap_fix (diff)
downloadfrr-406537cb703c652ec275ae7e824efb2009634837.tar.xz
frr-406537cb703c652ec275ae7e824efb2009634837.zip
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 <renato@opensourcerouting.org>
-rw-r--r--staticd/static_vty.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/staticd/static_vty.c b/staticd/static_vty.c
index 476340693..9ebc13482 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;
}
}