nixos-module/container/bird: simplify filter operations

legacy
Astro 2 years ago
parent 67acfb140b
commit 6b6f3d5598

@ -40,14 +40,14 @@ in
''}
${lib.optionalString isUpstream ''
export filter {
if net ~ [ 0.0.0.0/0 ] then {
if net = 0.0.0.0/0 then {
# Do not set another default route on upstreams
reject;
}
accept;
};
import filter {
if net ~ [ 0.0.0.0/0 ] then {
if net = 0.0.0.0/0 then {
# Learn the upstream default route
accept;
}
@ -64,7 +64,7 @@ in
''}
${lib.optionalString isUpstream ''
export filter {
if net ~ [ ::/0 ] then {
if net = ::/0 then {
# Do not set another default route on upstreams
reject;
}
@ -72,7 +72,7 @@ in
};
# Learn the upstream default route
import filter {
if net ~ [ ::/0 ] then {
if net = ::/0 then {
accept;
}
reject;
@ -90,7 +90,7 @@ in
table master4;
peer table vpn4_table;
export filter {
if net ~ [ 0.0.0.0/0 ] then {
if net = 0.0.0.0/0 then {
# Copy default route to vpn4 table
accept;
}
@ -137,7 +137,7 @@ in
ipv4 {
export all;
import filter {
if net ~ [ 0.0.0.0/0 ] then {
if net = 0.0.0.0/0 then {
${(builtins.foldl' (result: gateway: {
text = ''
${result.text}
@ -197,7 +197,7 @@ in
ipv6 {
export all;
import filter {
if net ~ [ ::/0 ] then {
if net = ::/0 then {
${(builtins.foldl' (result: gateway: {
text = ''
${result.text}

Loading…
Cancel
Save