shill: connection: Work around broken netmasks

It has been observed in the field that some network infrastructures
send a gateway/netmask pair that is inconsistent and prevents the
client from contacting the gateway.  Work around this by expanding
the netmask, assuming that this parameter is incorrect.  However,
use sane defaults for maximum expansion of the netmask, so that
we do not completely break things.

BUG=chromium-os:29416
TEST=New unit tests.

Change-Id: Id4730a8c1555fb09033175bdf2bfba1abe93a125
Reviewed-on: https://gerrit.chromium.org/gerrit/20465
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
diff --git a/mock_routing_table.h b/mock_routing_table.h
index ceae2bd..a174ac2 100644
--- a/mock_routing_table.h
+++ b/mock_routing_table.h
@@ -25,7 +25,7 @@
                                      IPAddress::Family family,
                                      RoutingTableEntry *entry));
   MOCK_METHOD3(SetDefaultRoute, bool(int interface_index,
-                                     const IPConfigRefPtr &ipconfig,
+                                     const IPAddress &gateway_address,
                                      uint32 metric));
   MOCK_METHOD3(ConfigureRoutes, bool(int interface_index,
                                      const IPConfigRefPtr &ipconfig,