From 6b6f3d55981ddb687fc5fe0a8dd5d033091ad688 Mon Sep 17 00:00:00 2001 From: Astro Date: Fri, 30 Apr 2021 00:16:00 +0200 Subject: [PATCH] nixos-module/container/bird: simplify filter operations --- nix/nixos-module/container/bird.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/nix/nixos-module/container/bird.nix b/nix/nixos-module/container/bird.nix index d3ad5ce..f1f5387 100644 --- a/nix/nixos-module/container/bird.nix +++ b/nix/nixos-module/container/bird.nix @@ -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}