Returning a pointer to a static buffer in an object that is later
deleted results in an empty IP header, depending on the compiler and
optimisation level.
Instead we can write directly inside the packet buffer.
inet_ntoa returns a pointer to a fixed buffer.
If called multiple times during the evaluating of an expression the
buffer will be overwritten and the addresses will appear duplicated.
The sockets are bound on all interfaces using INADDR_ANY, so getsockname
always return 0.0.0.0.
The actual address can be obtained from the destination address of the
received IP packet using the socket ancillary data.