]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Fix IPv6 in port-share journal
authorcorubba <corubba@gmx.de>
Sat, 7 Dec 2024 23:17:05 +0000 (00:17 +0100)
committerGert Doering <gert@greenie.muc.de>
Sun, 8 Dec 2024 13:57:25 +0000 (14:57 +0100)
commitf966e67c24af681cdd8c3905f4da07e616a123c5
tree9daa812ef528def192b295f5b583f3fc5902112e
parent2776810696bf8a56525ac7a2765c3d3f2ac9d23e
Fix IPv6 in port-share journal

getpeername() and getsockname() will truncate the result if it is
larger than the passed-in length. Because here always the size of the
`sa` IPv4 union member was passed in, all larger (aka IPv6) results
were truncated. Instead use the size of the `addr` union, which is the
maximum size of all union members.

The bug was introduced in 0b6450c9.

Trac: #1358

Signed-off-by: corubba <corubba@gmx.de>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <8de5660b-d917-4092-8871-250495d8c7a4@gmx.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg30035.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit dbc0491f20c34cf3b7ab8fe2a55442ea93007ddd)
src/openvpn/ps.c