Loading
nixos/firewall: fix reverse path check failures with IPsec
The endpoint of an IPsec tunnel receives encrypted IPsec packets that are first decrypted and then forwarded to the intended destination. The decrypted traffic appears to originate from the same interface it came in from, so in most cases these packets will fail the reverse path check even if legitimate. This change adds an exception to not reject packets that were previously IPsec-encrypted, meaning the have been accepted, decrypted and are in the process of being forwarded to their final destinal. Sources: - https://www.kernel.org/doc/Documentation/networking/xfrm_device.txt - https://git.netfilter.org/nftables/commit/?id=49f6e9a846c6c8325b95debe04d5ebc3c01246fb - https://git.netfilter.org/nftables/commit/?id=8f55ed41d007061bd8aae94fee2bda172c0e8996 - https://thermalcircle.de/doku.php?id=blog:linux:nftables_demystifying_ipsec_expressions