Unsupported empty lists - why?
Hello, being a bird 1.6 user (Debian), I find myself often in the situation that I'd like to define a variable in either bird.conf or bird6.conf and have a general.conf that defines the filters used in both protocols. However if I have a variable, for instance net_prefer_provider_a = [ s.o.m.e/prefix+ ]; in bird6.conf, but not don't prefer IPv4 traffic from any network of this provider, I'd like to define net_prefer_provider_a = []; However this is not supported in bird1.6. Now I tried to get around this problem by using defined(), however this code also does not work: if defined(net_prefer_to_a) then { if net ~ net_prefer_to_a then { bgp_local_pref = pref_high; } } net_prefer_to_a is defined in IPv6, but not in IPv4. This gives the error message: /etc/bird/general.conf:128:40 net_prefer_to_a: variable expected. How do you handle default or empty values for sets of prefixes? Best, Nico -- Your Swiss, Open Source and IPv6 Virtual Machine. Now on www.datacenterlight.ch.
On September 18, 2019 7:46:15 AM GMT+02:00, Nico Schottelius <nico.schottelius@ungleich.ch> wrote:
Hello,
being a bird 1.6 user (Debian), I find myself often in the situation that I'd like to define a variable in either bird.conf or bird6.conf and have a general.conf that defines the filters used in both protocols.
However if I have a variable, for instance net_prefer_provider_a = [ s.o.m.e/prefix+ ]; in bird6.conf, but not don't prefer IPv4 traffic from any network of this provider, I'd like to define
net_prefer_provider_a = [];
However this is not supported in bird1.6. Now I tried to get around this problem by using defined(), however this code also does not work:
if defined(net_prefer_to_a) then { if net ~ net_prefer_to_a then { bgp_local_pref = pref_high; } }
You should declare net_prefer_to_a as a variable. And if you don't initialize it, then defined(...) is false.
net_prefer_to_a is defined in IPv6, but not in IPv4.
This gives the error message:
/etc/bird/general.conf:128:40 net_prefer_to_a: variable expected.
This means that the lexer doesn't know the symbol at all. Maria -- Sent from my Android device with K-9 Mail. Please excuse my brevity.
On Wed, Sep 18, 2019 at 02:46:15PM +0900, Nico Schottelius wrote:
Hello,
being a bird 1.6 user (Debian), I find myself often in the situation that I'd like to define a variable in either bird.conf or bird6.conf and have a general.conf that defines the filters used in both protocols.
Hello The reason why we do not support empty sets is because we have more types of sets (prefix sets, integer sets, ...) and they have even different implementation. With empty set literal it would be hard to decide which type of set it should be. Trivial workaround is to add some prefix that is invalid anyway, like 0.0.0.0/32. -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
Hey Ondrej, I just tried this with IPv6 as follows and get a "funny" error message: bird> conf Reading configuration from /etc/bird/bird6.conf /etc/bird/bird6.conf:48:32 net_unused: set-incompatible type bird> config: define net_unused = ::/128; ... define net_prefer_to_init7 = [ net_unused ]; When I change this to directly including the network: bird> conf Reading configuration from /etc/bird/bird6.conf /etc/bird/bird6.conf:53:13 syntax error bird> config: define net_prefer_to_init7 = [ ::/128 ]; As far as I can see, this is a valid route and I wanted to use this for empty IPv6 sets. Am I doing something completely wrong here? Ondrej Zajicek <santiago@crfreenet.org> writes:
On Wed, Sep 18, 2019 at 02:46:15PM +0900, Nico Schottelius wrote:
Hello,
being a bird 1.6 user (Debian), I find myself often in the situation that I'd like to define a variable in either bird.conf or bird6.conf and have a general.conf that defines the filters used in both protocols.
Hello
The reason why we do not support empty sets is because we have more types of sets (prefix sets, integer sets, ...) and they have even different implementation. With empty set literal it would be hard to decide which type of set it should be.
Trivial workaround is to add some prefix that is invalid anyway, like 0.0.0.0/32.
-- Your Swiss, Open Source and IPv6 Virtual Machine. Now on www.datacenterlight.ch.
Update: the syntax error actually came from a different line, my mistake. I was able to syntactically correct create a config using define net_prefer_to_init7 = false; and then later if net ~ net_prefer_to_init7 then { bgp_local_pref = pref_high; } Nico Schottelius <nico.schottelius@ungleich.ch> writes:
Hey Ondrej,
I just tried this with IPv6 as follows and get a "funny" error message:
bird> conf Reading configuration from /etc/bird/bird6.conf /etc/bird/bird6.conf:48:32 net_unused: set-incompatible type bird>
config:
define net_unused = ::/128; ... define net_prefer_to_init7 = [ net_unused ];
When I change this to directly including the network:
bird> conf Reading configuration from /etc/bird/bird6.conf /etc/bird/bird6.conf:53:13 syntax error bird>
config:
define net_prefer_to_init7 = [ ::/128 ];
As far as I can see, this is a valid route and I wanted to use this for empty IPv6 sets.
Am I doing something completely wrong here?
Ondrej Zajicek <santiago@crfreenet.org> writes:
On Wed, Sep 18, 2019 at 02:46:15PM +0900, Nico Schottelius wrote:
Hello,
being a bird 1.6 user (Debian), I find myself often in the situation that I'd like to define a variable in either bird.conf or bird6.conf and have a general.conf that defines the filters used in both protocols.
Hello
The reason why we do not support empty sets is because we have more types of sets (prefix sets, integer sets, ...) and they have even different implementation. With empty set literal it would be hard to decide which type of set it should be.
Trivial workaround is to add some prefix that is invalid anyway, like 0.0.0.0/32.
-- Your Swiss, Open Source and IPv6 Virtual Machine. Now on www.datacenterlight.ch.
participants (3)
-
Maria Matějka -
Nico Schottelius -
Ondrej Zajicek