diff options
author | Sebastian Benoit <benno@cvs.openbsd.org> | 2018-09-08 09:18:35 +0000 |
---|---|---|
committer | Sebastian Benoit <benno@cvs.openbsd.org> | 2018-09-08 09:18:35 +0000 |
commit | f7bfc4770cd1cedf25b81174adf29c50974e447a (patch) | |
tree | 3bc773ab9ca10d91fbe96c3661cc354e508fdd75 /regress | |
parent | 85193f22dc775826582893950a3ce6e3c7d5d2fb (diff) |
add a check for curly braces in a macro being used inside a filter
rule with curly braces
Diffstat (limited to 'regress')
-rw-r--r-- | regress/usr.sbin/bgpd/config/Makefile | 4 | ||||
-rw-r--r-- | regress/usr.sbin/bgpd/config/bgpd.conf.3.in | 25 | ||||
-rw-r--r-- | regress/usr.sbin/bgpd/config/bgpd.conf.3.ok | 31 |
3 files changed, 58 insertions, 2 deletions
diff --git a/regress/usr.sbin/bgpd/config/Makefile b/regress/usr.sbin/bgpd/config/Makefile index adaac5344b7..4181cbbf9c4 100644 --- a/regress/usr.sbin/bgpd/config/Makefile +++ b/regress/usr.sbin/bgpd/config/Makefile @@ -1,6 +1,6 @@ -# $OpenBSD: Makefile,v 1.1 2018/09/07 08:38:35 claudio Exp $ +# $OpenBSD: Makefile,v 1.2 2018/09/08 09:18:34 benno Exp $ -BGPDTESTS=1 2 +BGPDTESTS=1 2 3 REGRESS_TARGETS = config diff --git a/regress/usr.sbin/bgpd/config/bgpd.conf.3.in b/regress/usr.sbin/bgpd/config/bgpd.conf.3.in new file mode 100644 index 00000000000..1348a1f7688 --- /dev/null +++ b/regress/usr.sbin/bgpd/config/bgpd.conf.3.in @@ -0,0 +1,25 @@ +# $OpenBSD: bgpd.conf.3.in,v 1.1 2018/09/08 09:18:34 benno Exp $ +# in filter commands, test curly braces inside curly braces + +AS 1 + +somepeer_v6 = "2001:DB8::1" + +somenets_v6 = "{ \ + 2001:DB8:100::/64 \ + 2001:DB8:200::/64 \ + 2001:DB8:300::/64 \ + }" + +somemore_v6 = "{ \ + 2001:DB8:400::/64 \ + 2001:DB8:500::/64 \ + }" + +neighbor $somepeer_v6 { + remote-as 64496 + descr "v6SOMEPEER" +} + +allow from $somepeer_v6 prefix $somenets_v6 +allow from $somepeer_v6 prefix { $somenets_v6 $somemore_v6 } diff --git a/regress/usr.sbin/bgpd/config/bgpd.conf.3.ok b/regress/usr.sbin/bgpd/config/bgpd.conf.3.ok new file mode 100644 index 00000000000..912771bb9aa --- /dev/null +++ b/regress/usr.sbin/bgpd/config/bgpd.conf.3.ok @@ -0,0 +1,31 @@ +somepeer_v6 = "2001:DB8::1" +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 +router-id 127.0.0.1 +socket "/var/run/bgpd.sock.0" +holdtime min 3 +fib-priority 48 + + +rde rib Adj-RIB-In no evaluate +rde rib Adj-RIB-Out no evaluate +rde rib Loc-RIB rtable 0 fib-update yes + + +neighbor 2001:db8::1 { + descr "v6SOMEPEER" + remote-as 64496 + enforce neighbor-as yes + enforce local-as yes + announce IPv6 unicast +} + +allow from 2001:db8::1 prefix 2001:db8:300::/64 +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:300::/64 +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 |