diff options
Diffstat (limited to 'staticd/static_vty.c')
| -rw-r--r-- | staticd/static_vty.c | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/staticd/static_vty.c b/staticd/static_vty.c index ba1a8f9a25..4821671554 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; } } @@ -257,8 +243,9 @@ static int static_route_leak(struct vty *vty, const char *svrf, strlcpy(ab_xpath, xpath_nexthop, sizeof(ab_xpath)); strlcat(ab_xpath, FRR_STATIC_ROUTE_NH_COLOR_XPATH, sizeof(ab_xpath)); - nb_cli_enqueue_change(vty, ab_xpath, NB_OP_MODIFY, - color_str); + if (color_str) + nb_cli_enqueue_change(vty, ab_xpath, + NB_OP_MODIFY, color_str); } if (label_str) { /* copy of label string (start) */ @@ -436,7 +423,8 @@ int static_config(struct vty *vty, struct static_vrf *svrf, afi_t afi, nh->snh_label.label, buf, sizeof(buf), 0)); - if (nh->nh_vrf_id != GET_STABLE_VRF_ID(info)) + if (!strmatch(nh->nh_vrfname, + info->svrf->vrf->name)) vty_out(vty, " nexthop-vrf %s", nh->nh_vrfname); |
