I am exercising Linux timestamping capabilities (TX timestamps in particular).
Everything is working fine, I just cannot understand why reading from MSG_ERRQUEUE has to give me two ancillary messages: SO_TIMESTAMPING & IP_RECVERR.
That's perfectly aligned with kernel documentation: https://docs.kernel.org/networking/timestamping.html
2.1.1 Transmit timestamps with MSG_ERRQUEUE. For transmit timestamps the outgoing packet is looped back to the socket’s error queue with the send timestamp(s) attached. A process receives the timestamps by calling recvmsg() with flag MSG_ERRQUEUE set and with a msg_control buffer sufficiently large to receive the relevant metadata structures. The recvmsg call returns the original outgoing data packet with two ancillary messages attached.
I cannot imagine how I am supposed to use IP_RECVERR message as without it I can still read SO_TIMESTAMPING ancillary data.
Does anyone have an idea?