]> git.ipfire.org Git - thirdparty/FORT-validator.git/commit
Warn if server.address has more than one wildcard
authorAlberto Leiva Popper <ydahhrk@gmail.com>
Thu, 8 Feb 2024 21:58:25 +0000 (15:58 -0600)
committerAlberto Leiva Popper <ydahhrk@gmail.com>
Thu, 8 Feb 2024 22:02:16 +0000 (16:02 -0600)
commit4400b2132ed5247fd2f409da227ddf6e799ba4a6
treece83cdd005c8d84d45202cf701967d25568d1c8f
parent202e0fe34dc3c8dcb1a0ad12faa7f4d5a7c91b2d
Warn if server.address has more than one wildcard

Consider the following three definitions of server.address:

[a] "address": [ "0.0.0.0" ]
[b] "address": [ "::" ]
[c] "address": [ "0.0.0.0", "::" ]

We expect [a] to bind the socket to any IPv4 address,
[b] to bind the socket to any IPv6 address,
and [c] to bind the socket to any IPv4 and IPv6 address.

Right? The BSDs work that way.

But Linux doesn't. For Linux,

[a] binds to any IPv4 address,
[b] binds to any IPv4 and IPv6 address,
and [c] is an error.

But I don't want to override the behavior because some admins are
probably used to it:

linux$ nc -6lknv :: 7890
Listening on :: 7890
Connection received on ::1 52814
Hello from IPv6!
Connection received on ::ffff:127.0.0.1 55456
Hello from IPv4!

Instead, let's print a warning.

Thanks to Benjamim Pinheiro for reporting this quirk.
src/rtr/rtr.c