]> git.ipfire.org Git - thirdparty/openvpn.git/commit
multi: skip IPv4 logic in multi_select_virtual_addr() if no pool is configured
authorAntonio Quartulli <a@unstable.cc>
Wed, 10 Jun 2020 08:45:49 +0000 (10:45 +0200)
committerGert Doering <gert@greenie.muc.de>
Wed, 10 Jun 2020 09:24:39 +0000 (11:24 +0200)
commit9002885bd8a10d9375dc4f0baf2df05395c86f1a
treebf8560af9c350995074e1216ec98324357b284d5
parent28e395856c897b6f2dea441dbe5eb4a151d75b85
multi: skip IPv4 logic in multi_select_virtual_addr() if no pool is configured

When no IPv4 pool is configured (but we have an IPv6 pool
only), the multi_select_virtual_addr() function will spit
a warning when allocating an address for a new client.
This happens because the code will check for some IPv4
bits and will see that they are missing.

However, these bits are not really important, because in
this use case we don't want to configure any IPv4 address
at all.

For this reason it is safe to wrap this entire logic in
an if-block that just does not execute when no IPv4 pool
is configured.

This avoids the warning and will also avoid any other
hidden side effect.

Reported-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20200610084549.4028-1-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg20012.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/multi.c