CHROMIUM: Log RTM_NEWLINK messages broadcast from the kernel (temporary)
authorJulius Werner <jwerner@chromium.org>
Fri, 19 Oct 2012 20:37:36 +0000 (13:37 -0700)
committerGerrit <chrome-bot@google.com>
Sat, 20 Oct 2012 00:48:28 +0000 (17:48 -0700)
commit0a06f97c7e44bbac8944732d7739ea95b79b2ac5
treebc09fa5f6094ac132e74708e5f84c09ede0407ec
parent891b0f4e22f683353457415bfdfb48e08afe5e7a
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>
net/netlink/af_netlink.c