diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-09-11 13:35:32 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-11 13:35:32 -0400 |
| commit | fa0ebe5a8a27fde0ecaf9f52c6621368c785ad8c (patch) | |
| tree | 9c431baf7a953e5caa567362b833a7c6970213b4 /staticd/static_vty.c | |
| parent | e25352de4a340c42ab4b26959e5d63f24a7358c9 (diff) | |
| parent | b1ab2876fa8d02fbb84feafde8e321456409ec1a (diff) | |
Merge pull request #4302 from rgirada/fix_pim_upstream
staticd: static route config should get fail if nexthop configured as its local connected ip.
Diffstat (limited to 'staticd/static_vty.c')
| -rw-r--r-- | staticd/static_vty.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/staticd/static_vty.c b/staticd/static_vty.c index 3a9e4e8fa4..f926e1d9cd 100644 --- a/staticd/static_vty.c +++ b/staticd/static_vty.c @@ -35,7 +35,6 @@ #ifndef VTYSH_EXTRACT_PL #include "staticd/static_vty_clippy.c" #endif - static struct static_vrf *static_vty_get_unknown_vrf(struct vty *vty, const char *vrf_name) { @@ -479,6 +478,23 @@ static int static_route_leak( return CMD_WARNING_CONFIG_FAILED; } gatep = &gate; + + if (afi == AFI_IP && !negate) { + if (if_lookup_exact_address(&gatep->ipv4, AF_INET, + svrf->vrf->vrf_id)) + if (vty) + vty_out(vty, + "%% Warning!! Local connected address is configured as Gateway IP(%s)\n", + gate_str); + } else if (afi == AFI_IP6 && !negate) { + if (if_lookup_exact_address(&gatep->ipv6, AF_INET6, + svrf->vrf->vrf_id)) + if (vty) + vty_out(vty, + "%% Warning!! Local connected address is configured as Gateway IPv6(%s)\n", + gate_str); + } + } if (gate_str == NULL && ifname == NULL) |
