check_ethernet: perform ping check more selectively
We only intend to do this check
(a) initially; to see whether we need to do any recovery at all and
(b) after a recovery_method claims to have performed an action
For (b), this comes when the recovery_method returns 0 (success), and so
we move on to the latter phase of the loop.
Therefore, (a) can be moved outside the loop, saving time.
Tested-by: Brian Norris <email@example.com>
Commit-Ready: ChromeOS CL Exonerator Bot <firstname.lastname@example.org>
Legacy-Commit-Queue: Commit Bot <email@example.com>
Reviewed-by: Grant Grundler <firstname.lastname@example.org>
1 file changed