Skip to content

Commit

Permalink
Merge pull request #12401 from FRRouting/mergify/bp/stable/8.3/pr-12370
Browse files Browse the repository at this point in the history
bgpd: Fix crash for `set ipv4/ipv6 vpn next-hop` command (backport #12370)
  • Loading branch information
ton31337 committed Nov 26, 2022
2 parents 5546e2a + 100f6c5 commit e06a8de
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions bgpd/bgp_routemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -6605,9 +6605,9 @@ DEFUN_YANG (no_set_vpn_nexthop,
}
#endif /* KEEP_OLD_VPN_COMMANDS */

DEFUN_YANG (set_ipx_vpn_nexthop,
DEFPY_YANG (set_ipx_vpn_nexthop,
set_ipx_vpn_nexthop_cmd,
"set <ipv4|ipv6> vpn next-hop <A.B.C.D|X:X::X:X>",
"set <ipv4|ipv6> vpn next-hop <A.B.C.D$addrv4|X:X::X:X$addrv6>",
SET_STR
"IPv4 information\n"
"IPv6 information\n"
Expand All @@ -6623,6 +6623,11 @@ DEFUN_YANG (set_ipx_vpn_nexthop,

if (argv_find_and_parse_afi(argv, argc, &idx, &afi)) {
if (afi == AFI_IP) {
if (addrv6_str) {
vty_out(vty, "%% IPv4 next-hop expected\n");
return CMD_WARNING_CONFIG_FAILED;
}

const char *xpath =
"./set-action[action='frr-bgp-route-map:ipv4-vpn-address']";

Expand All @@ -6632,6 +6637,11 @@ DEFUN_YANG (set_ipx_vpn_nexthop,
"%s/rmap-set-action/frr-bgp-route-map:ipv4-address",
xpath);
} else {
if (addrv4_str) {
vty_out(vty, "%% IPv6 next-hop expected\n");
return CMD_WARNING_CONFIG_FAILED;
}

const char *xpath =
"./set-action[action='frr-bgp-route-map:ipv6-vpn-address']";

Expand Down

0 comments on commit e06a8de

Please sign in to comment.