check_ethernet.hook: Do not ignore network devices with link

The check_ethernet.hook script ignores devices with the
"cdc_ether" driver, presumably to avoid testing cellular
interfaces.  This driver isn't exclusive to cellular devices,
however (nor is it inclusive of all cellular devices).  As
such, it is prudent to test such devices if, for example,
they report themselves as currently connected.

There are two downsides to this change: on cellular-equipped
devices, this incurs a time penalty in situations where the
celluar device happens to be connected, since a ping attempt
will be performed there.   It also incurs a possible false-
positive in situations where the default gateway or ssh host
is reachable through this alternate interface, however the
chances of this being true are very slim indeed and already
exists since the script doesn't eliminate WiFi devices or
celluar devices that use a driver other than "cdc_ether".

One alternate  approach would be to remove the "cdc_ether" test
altogether, which seems risky without properly understanding
the original reasoning, and at best would delay testing by
trying devices that were doomed to fail.

Another alternate approach would be to use the connection
manager, which knows how to successfully discern between
Ethernet and wireless WAN devices.  This adds a direct
dependency on the connection manager D-Bus APIs which
probably should not happen here without deeper contemplation.

BUG=chromium:445705
TEST=Manual: run on a host with a USB-Ethernet interface
that uses the "cdc_ether" driver.  Note that the system now
does not restart the connection manager at regular intervals.

Change-Id: I61a9ffba2f91d2b49f61b54504f6ce8d8522d363
Reviewed-on: https://chromium-review.googlesource.com/243481
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
(cherry picked from commit 661c1e7c808158e0b7112f25a6d5409ecd68bb1a)
Reviewed-on: https://chromium-review.googlesource.com/245099
Reviewed-by: Paul Stewart <pstew@chromium.org>
1 file changed