From 6b4acfc2c0ab2a45be0f50050999a8eaed1aea62 Mon Sep 17 00:00:00 2001 From: Viacheslav Hletenko Date: Wed, 30 Aug 2023 13:30:20 +0000 Subject: T4475: route-map allow IPv6 address for match peer option set policy route-map foo rule 100 action 'permit' set policy route-map foo rule 100 match peer 'fe80::2' --- scripts/policy/vyatta-policy.pl | 1 + templates/policy/route-map/node.tag/rule/node.tag/match/peer/node.def | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/policy/vyatta-policy.pl b/scripts/policy/vyatta-policy.pl index f098b48a..b2acab8f 100755 --- a/scripts/policy/vyatta-policy.pl +++ b/scripts/policy/vyatta-policy.pl @@ -45,6 +45,7 @@ sub check_peer_syntax { $_ = $peer; if (/^local$/) { exit 0; } if ( isIpAddress("$peer") ) { exit 0; } + if ( $peer =~ /^[0-9a-fA-F:]+$/) { exit 0; } exit 1; } diff --git a/templates/policy/route-map/node.tag/rule/node.tag/match/peer/node.def b/templates/policy/route-map/node.tag/rule/node.tag/match/peer/node.def index ea8fcddc..25465640 100644 --- a/templates/policy/route-map/node.tag/rule/node.tag/match/peer/node.def +++ b/templates/policy/route-map/node.tag/rule/node.tag/match/peer/node.def @@ -1,6 +1,7 @@ type: txt help: Peer address to match val_help: ipv4; Peer IP address +val_help: ipv6; Peer IPv6 address val_help: local: Static or redistributed routes syntax:expression: exec "/opt/vyatta/sbin/vyatta-policy.pl --check-peer-syntax $VAR(@)"; "peer must be either an IP or local" -- cgit v1.2.3