This patch adds a new socket option SO_CLOCKTYPE to pick from several different clock sources to return timestamps when SO_TIMESTAMP is enabled. Two additional clock sources are:
o nanosecond resolution realtime clock (equivalent of CLOCK_REALTIME);
o nanosecond resolution monotonic clock (equivalent of CLOCK_MONOTONIC).
In addition to this, this option provides unified interface to get bintime (equivalent of using SO_BINTIME), except it also supported with IPv6 where SO_BINTIME has never been supported. The long term plan is to depreciate SO_BINTIME and move everything to using SO_CLOCKTYPE.
Idea for this enhancement has been briefly discussed on the Net session during dev summit in Ottawa last May and the general input was positive.
This change is believed to benefit network benchmarks/profiling as well as other scenarios where precise time of arrival measurement is necessary.