summaryrefslogtreecommitdiffstats
path: root/lib/routemap.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas.abraitis@gmail.com>2018-09-14 10:56:46 +0200
committerDonatas Abraitis <donatas.abraitis@gmail.com>2018-10-11 09:56:12 +0200
commit1de27621531b996db577f67fb43483286571dbf2 (patch)
treed8d1a31d568de76b818bb53f7bc1c445553a6c1b /lib/routemap.c
parentMerge pull request #3098 from opensourcerouting/watchfrr-delay (diff)
downloadfrr-1de27621531b996db577f67fb43483286571dbf2.tar.xz
frr-1de27621531b996db577f67fb43483286571dbf2.zip
bgpd: Check if route-map really exists before applying to the peer
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'lib/routemap.c')
-rw-r--r--lib/routemap.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/routemap.c b/lib/routemap.c
index bc45cd51d..3a20ed5cd 100644
--- a/lib/routemap.c
+++ b/lib/routemap.c
@@ -811,6 +811,18 @@ struct route_map *route_map_lookup_by_name(const char *name)
return map;
}
+/* Simple helper to warn if route-map does not exist. */
+struct route_map *route_map_lookup_warn_noexist(struct vty *vty, const char *name)
+{
+ struct route_map *route_map = route_map_lookup_by_name(name);
+
+ if (!route_map)
+ if (vty_shell_serv(vty))
+ vty_out(vty, "The route-map '%s' does not exist.\n", name);
+
+ return route_map;
+}
+
int route_map_mark_updated(const char *name)
{
struct route_map *map;