mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 05:18:47 +00:00
lib, bgpd: fix set ip next-hop peer-address
This bgp-specific command had its positive form defined only in bgpd and its negative form defined only in lib, which broke the whole rule for other daemons. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
parent
043abefeb2
commit
89602edb31
@ -3499,14 +3499,20 @@ DEFUN (no_match_origin,
|
||||
|
||||
DEFUN (set_ip_nexthop_peer,
|
||||
set_ip_nexthop_peer_cmd,
|
||||
"set ip next-hop peer-address",
|
||||
"[no] set ip next-hop peer-address",
|
||||
NO_STR
|
||||
SET_STR
|
||||
IP_STR
|
||||
"Next hop address\n"
|
||||
"Use peer address (for BGP only)\n")
|
||||
{
|
||||
return generic_set_add(vty, VTY_GET_CONTEXT(route_map_index),
|
||||
"ip next-hop", "peer-address");
|
||||
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",
|
||||
"peer-address");
|
||||
}
|
||||
|
||||
DEFUN (set_ip_nexthop_unchanged,
|
||||
|
@ -2194,24 +2194,24 @@ DEFUN (set_ip_nexthop,
|
||||
|
||||
DEFUN (no_set_ip_nexthop,
|
||||
no_set_ip_nexthop_cmd,
|
||||
"no set ip next-hop [<peer-address|A.B.C.D>]",
|
||||
"no set ip next-hop [A.B.C.D]",
|
||||
NO_STR
|
||||
SET_STR
|
||||
IP_STR
|
||||
"Next hop address\n"
|
||||
"Use peer address (for BGP only)\n"
|
||||
"IP address of next hop\n")
|
||||
{
|
||||
int idx_peer = 4;
|
||||
int idx;
|
||||
VTY_DECLVAR_CONTEXT(route_map_index, index);
|
||||
const char *arg = NULL;
|
||||
|
||||
if (rmap_match_set_hook.no_set_ip_nexthop) {
|
||||
if (argc <= idx_peer)
|
||||
return rmap_match_set_hook.no_set_ip_nexthop(
|
||||
vty, index, "ip next-hop", NULL);
|
||||
if (argv_find(argv, argc, "A.B.C.D", &idx))
|
||||
arg = argv[idx]->arg;
|
||||
|
||||
if (rmap_match_set_hook.no_set_ip_nexthop)
|
||||
return rmap_match_set_hook.no_set_ip_nexthop(
|
||||
vty, index, "ip next-hop", argv[idx_peer]->arg);
|
||||
}
|
||||
vty, index, "ip next-hop", arg);
|
||||
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user