I looking at this code https://elixir.bootlin.com/linux/v4.6.7/source/Documentation/networking/timestamping/timestamping.c#L181
This code try to print the timestamp of packet using struct timespec *stamp = (struct timespec *)CMSG_DATA(cmsg);
If this is UDP packet.
Is there any way that CMSG_DATA(cmsg) will return NULL?
If you look at the definition of CMSG_DATA you see
This adds an offset to
cmsg. Unless you manage to feed acmsginto that macro that evaluates toNULLafter adding that offset, the result can never be comeNULL.