shill: Make the default Connection::metric_ work on IPv6
The kernel's IPv4 implementation allows routes with metric 0 to be
created, but the kernel's IPv6 implementation changes metric 0
routes to metric 1024. This causes shill's route cache to get out
of sync with the running kernel, causing the default IPv6 route to
be unexpectedly deleted under some circumstances. Fix this by
defaulting to kNonDefaultMetricBase (10) instead of 0.
BUG=chromium:727242
TEST=manually hack device.cc to delay IPv4 address assignment, then
check the logs to see what happens when UpdateFromIPConfig() is
run on an IPv6 configuration
TEST=unit tests
Change-Id: Iac4d6ef3a881f2820a4ef4dd3fdda6475937d5f9
Reviewed-on: https://chromium-review.googlesource.com/580643
Commit-Ready: Kevin Cernekee <cernekee@chromium.org>
Tested-by: Kevin Cernekee <cernekee@chromium.org>
Reviewed-by: Kevin Cernekee <cernekee@chromium.org>
(cherry picked from commit 99871907defbef52a657a0f88bdcced5ee58270a)
2 files changed