|
From: Gert D. <ge...@gr...> - 2024-12-08 13:53:06
|
Hi,
On Sun, Dec 08, 2024 at 12:17:05AM +0100, corubba via Openvpn-devel wrote:
> 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.
Thanks for digging into this. The fix looks correct according to
structure definitions, "man getpeername()" etc. - and now matches
other parts of the code, like socket.c / socket_do_accept()
...
socklen_t remote_len = sizeof(act->dest.addr);
...
new_sd = getpeername(sd, &act->dest.addr.sa, &remote_len);
The commit ID you found introduces IPv6 transport support :-) - so before
that, there was no ambiguity here.
So
Acked-By: Gert Doering <ge...@gr...>
will proceed to merge ASAP. (I'll change the Trac reference to be
just "Trac: #1358" as this is our standard format).
gert
--
"If was one thing all people took for granted, was conviction that if you
feed honest figures into a computer, honest figures come out. Never doubted
it myself till I met a computer with a sense of humor."
Robert A. Heinlein, The Moon is a Harsh Mistress
Gert Doering - Munich, Germany ge...@gr...
|