netlink: add netlink handler for gfeatures (-k)

Implement "ethtool -k <dev>" subcommand using ETHTOOL_MSG_FEATURES_GET
netlink message. This retrieves and displays names and values of netdev
feature flags, traditionally provided by ioctl request ETHTOOL_GFEATURES
(and some older ones).

Unlike ioctl, the netlink code does not query kernel for values of legacy
flags (ETH_FLAG_*) and computes their value from features grouped under
such flag instead so that it can get slightly different results than ioctl
implementation in cases where some new feature is not considered by kernel
code (kernel fix is going to be submitted soon).

This commit also registers the callback with monitor code so that the
monitor can display ETHTOOL_MSG_FEATURES_NTF notifications.

Signed-off-by: Michal Kubecek <>
10 files changed