CHROMIUM: Log RTM_NEWLINK messages broadcast from the kernel (temporary)
Several recent bug reports document a problem where attached USB
Ethernet adapters are not correctly detected by shill. The issue
persists until reboot once it has happened, but is not generally
reproducable. Logs show that the kernel correctly loads the appropriate
driver, so the issue is believed to be caused by communication problems
between the kernel and shill (via NETLINK_ROUTE sockets).
This patch logs every broadcast of a netlink message with the
RTM_NEWLINK type from the kernel. The surrounding code is slightly
augmented to gather a little more information about the amount of
receipients, but preserves the overall program logic in all cases.
This patch is intended to be temporary. It shall run on production
systems until more reports of the problem (with now more detailed info)
show up, which will hopefully help us nail it down. It should be rolled
back as soon as enough data is available. The additional log burden is
expected to be small (one message per addition, removal and flags change
of a network interface).
BUG=chrome-os-partner:14952,chromium-os:35479
TEST=Add new network interfaces to the system (e.g. by plugging in a USB
Ethernet adapter). Watch RTM_NEWLINK(...) messages appear in dmesg.
Change-Id: I5cf47d0991451679b8a52f9e982d1d695a4f2810
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36150
Reviewed-by: Sameer Nanda <snanda@chromium.org>