On Tue, Feb 7, 2017 at 6:01 AM, Miroslav Lichvar <mlich...@redhat.com> wrote: > 2) new SO_TIMESTAMPING option to receive from the error queue only > user data as was passed to sendmsg() instead of Ethernet frames > > Parsing Ethernet and IP headers (especially IPv6 options) is not > fun and SOF_TIMESTAMPING_OPT_ID is not always practical, e.g. in > applications which process messages from the error queue > asynchronously and don't bind/connect their sockets.
This is going to be quite useful. However, I'm not sure if sending back the original packet would be a proper API. Instead, one option is to add a control message, so that applications can set the OPT_ID for the timestamp. Perhaps, something like from user's perspective: cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_type = SCM_TIMESTAMPING_OPT_ID; cmsg->cmsg_len = CMSG_LEN(sizeof(__u32)); *((__u32 *) CMSG_DATA(cmsg)) = my_id; Thanks, Soheil