moved from misc@ (http://marc.info/?l=openbsd-misc&m=141898047318322&w=2)

On 2014-12-19, Tony Sarendal <[email protected]> wrote:
> From 5.5 and up it looks like bgpd macros are broken.

I suspect this is parse.y r1.268.

> Also, the example from bgpd.conf man page fails on 5.4-5.6.
> I haven't tested on 5.3 and lower.
>
> On 5.6 snapshot:
> tonsar@obc1$ uname -mrsv
> OpenBSD 5.6 GENERIC.MP#701 amd64
> tonsar@obc1$ cat bgpd.conf-2
> good="{ 192.168.0.0/16, 172.16.0.0/12, 10.0.0.0/8 }"
> bad="{ 224.0.0.0/4 prefixlen >= 4, 240.0.0.0/4 prefixlen >= 4 }"
> ugly="{ 127.0.0.1/8, 169.254.0.0/16 }"
> # global configuration
> AS 65001
> deny from any prefix { $good $bad $ugly }
> tonsar@obc1$ bgpd -f bgpd.conf-2 -nv
> good = "{ 192.168.0.0/16, 172.16.0.0/12, 10.0.0.0/8 }"
> bad = "{ 224.0.0.0/4 prefixlen >= 4, 240.0.0.0/4 prefixlen >= 4 }"
> ugly = "{ 127.0.0.1/8, 169.254.0.0/16 }"
> bgpd.conf-2:6: syntax error
> tonsar@obc1$

It looks like nested braces no longer work.

{ { 1.1.1.1/30 } { 2.2.2.2/30 } } - fails
{ 1.1.1.1/30 2.2.2.2/30 } - works

With my poor yacc skills the best I can do for now is suggest a manpage
diff, though other parsers (e.g. pf's) do allow nesting in this situation.

Index: bgpd.conf.5
===================================================================
RCS file: /cvs/src/usr.sbin/bgpd/bgpd.conf.5,v
retrieving revision 1.132
diff -u -p -r1.132 bgpd.conf.5
--- bgpd.conf.5 10 Nov 2014 20:48:33 -0000      1.132
+++ bgpd.conf.5 10 Jan 2015 14:13:58 -0000
@@ -1210,9 +1210,9 @@ deny from any prefix { 192.168.0.0/16, 1
 Multiple lists can also be specified, which is useful for
 macro expansion:
 .Bd -literal -offset indent
-good="{ 192.168.0.0/16, 172.16.0.0/12, 10.0.0.0/8 }"
-bad="{ 224.0.0.0/4 prefixlen >= 4, 240.0.0.0/4 prefixlen >= 4 }"
-ugly="{ 127.0.0.1/8, 169.254.0.0/16 }"
+good="192.168.0.0/16, 172.16.0.0/12, 10.0.0.0/8"
+bad="224.0.0.0/4 prefixlen >= 4, 240.0.0.0/4 prefixlen >= 4"
+ugly="127.0.0.1/8, 169.254.0.0/16"
 
 deny from any prefix { $good $bad $ugly }
 .Ed


Reply via email to