From 1337c42b0a1ac8b8897483faf8c073489f2ac9d0 Mon Sep 17 00:00:00 2001 From: claudio Date: Tue, 15 Mar 2022 11:16:25 +0000 Subject: [PATCH] Add a test for expanding macros in large-community strings. --- regress/usr.sbin/bgpd/config/bgpd.conf.3.in | 7 +++++-- regress/usr.sbin/bgpd/config/bgpd.conf.3.ok | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/regress/usr.sbin/bgpd/config/bgpd.conf.3.in b/regress/usr.sbin/bgpd/config/bgpd.conf.3.in index 1348a1f7688..edf95ce952b 100644 --- a/regress/usr.sbin/bgpd/config/bgpd.conf.3.in +++ b/regress/usr.sbin/bgpd/config/bgpd.conf.3.in @@ -1,10 +1,12 @@ -# $OpenBSD: bgpd.conf.3.in,v 1.1 2018/09/08 09:18:34 benno Exp $ +# $OpenBSD: bgpd.conf.3.in,v 1.2 2022/03/15 11:16:25 claudio Exp $ # in filter commands, test curly braces inside curly braces AS 1 somepeer_v6 = "2001:DB8::1" +someas = "64496" + somenets_v6 = "{ \ 2001:DB8:100::/64 \ 2001:DB8:200::/64 \ @@ -17,9 +19,10 @@ somemore_v6 = "{ \ }" neighbor $somepeer_v6 { - remote-as 64496 + remote-as $someas descr "v6SOMEPEER" } allow from $somepeer_v6 prefix $somenets_v6 allow from $somepeer_v6 prefix { $somenets_v6 $somemore_v6 } +match from $somepeer_v6 set large-community $someas:$someas:$someas diff --git a/regress/usr.sbin/bgpd/config/bgpd.conf.3.ok b/regress/usr.sbin/bgpd/config/bgpd.conf.3.ok index eba12e2f1f7..4478a03c85b 100644 --- a/regress/usr.sbin/bgpd/config/bgpd.conf.3.ok +++ b/regress/usr.sbin/bgpd/config/bgpd.conf.3.ok @@ -1,4 +1,5 @@ somepeer_v6 = "2001:DB8::1" +someas = "64496" somenets_v6 = "{ 2001:DB8:100::/64 2001:DB8:200::/64 2001:DB8:300::/64 }" somemore_v6 = "{ 2001:DB8:400::/64 2001:DB8:500::/64 }" AS 1 @@ -26,3 +27,4 @@ allow from 2001:db8::1 prefix 2001:db8:200::/64 allow from 2001:db8::1 prefix 2001:db8:100::/64 allow from 2001:db8::1 prefix 2001:db8:500::/64 allow from 2001:db8::1 prefix 2001:db8:400::/64 +match from 2001:db8::1 set { large-community 64496:64496:64496 } -- 2.20.1