]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Print remote IPv4 address on a dual-stack v6 socket in IPv4 format
authorGert Doering <gert@greenie.muc.de>
Mon, 29 Dec 2014 17:48:45 +0000 (18:48 +0100)
committerGert Doering <gert@greenie.muc.de>
Sun, 15 Feb 2015 22:04:12 +0000 (23:04 +0100)
commit0b1a68fffa33e175c320c2828604cdc7dfb097e7
treeb5cdbbf55798276eecca6f63de44100f30f6ca6b
parent9e0963c11aa439deb382d7d6bc40b6ade999401c
Print remote IPv4 address on a dual-stack v6 socket in IPv4 format

Previously, the code would print IPv4-mapped format ("::ffff:1.2.3.4"),
which is technically correct but adds no extra value, and is confusingly
different from the output if using a v4 socket.  Print "1.2.3.4" instead,
whatever socket type is used.

Affects client IP address in log file, status output (mroute_addr_print_ex),
and environment (setenv_sockaddr).

The fact that a dual-stack socket was used is still visible in the initial
peer connect message in the log:
  '... Peer Connection Initiated with [AF_INET6]::ffff:1.1.3.4:53779'

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <1419875325-96015-1-git-send-email-gert@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/9363
src/openvpn/mroute.c
src/openvpn/socket.c