@ivanuschak - related to:
- *from = &si->su;
+ memcpy(*from, &si->su, sockaddru_len(si->su));
What I wanted to comment about is that the size are different between the pointer to a structure and the structure itself. A pointer is 4 bytes on 32bit CPU and 8 bytes on 64bit CPU. So the &si->su
is a pointer (address), being 4/8bytes, *from
is written with 4/8 bytes.
The change makes the *from
to be written with sockaddru_len(si->su)
bytes. Is this correct in the way that *from
has the proper reserved/allocated size? For me it feels incorrect, the struct sockaddr_in6
is more than 8 bytes:
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.