From: Quentin Young Date: Thu, 10 Aug 2017 16:55:32 +0000 (-0400) Subject: bgpd: add `no set ip next-hop unchanged` X-Git-Tag: frr-4.0-dev~415^2 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=cca30ba8a9b5c77c1e23eec3db3a96b151c26061;p=mirror_frr.git bgpd: add `no set ip next-hop unchanged` Signed-off-by: Quentin Young --- diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c index 1398b2aa8..5a5d2a5d5 100644 --- a/bgpd/bgp_routemap.c +++ b/bgpd/bgp_routemap.c @@ -3517,14 +3517,20 @@ DEFUN (set_ip_nexthop_peer, DEFUN (set_ip_nexthop_unchanged, set_ip_nexthop_unchanged_cmd, - "set ip next-hop unchanged", + "[no] set ip next-hop unchanged", + NO_STR SET_STR IP_STR "Next hop address\n" "Don't modify existing Next hop address\n") { - return generic_set_add(vty, VTY_GET_CONTEXT(route_map_index), - "ip next-hop", "unchanged"); + int (*func)(struct vty *, struct route_map_index *, const char *, + const char *) = strmatch(argv[0]->text, "no") + ? generic_set_delete + : generic_set_add; + + return func(vty, VTY_GET_CONTEXT(route_map_index), "ip next-hop", + "unchanged"); }