diff options
author | Brandon Philips <brandon@ifup.co> | 2014-03-20 11:28:12 -0700 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-03-21 17:52:42 +0100 |
commit | 9765ce69e15fd294db9553777b621515fa57f2c6 (patch) | |
tree | 9ca1ebec1b4c2d6d99fba93f18e4e5fca6d50df6 /src/gudev | |
parent | 9e64dd72765ddc2583554ebed24eb2c824564838 (diff) |
network: dhcp: create explicit host route to gateway
Some DHCP servers gives you a netmask of 255.255.255.255 so the gateway is not
routable. Other DHCP client implementations look through the existing routes to
figure out if they should add an explicit host route. See below for a link.
However, it makes sense to just create the route explicitly whether it is
needed or not since it is explicit, makes the dhcp route entries independent of
other entries and saves us from knowing the state of the kernel tables.
After patch route table on a machine with a network (common case):
default via 10.0.2.2 dev ens3
10.0.2.0/24 dev ens3 proto kernel scope link src 10.0.2.15
10.0.2.2 dev ens3 scope link
After patch route table on a machine without a network (this case):
default via 10.240.0.1 dev ens4v1
10.240.0.1 dev ens4v1 scope link
The code from dhcpcd that works around this issue is on line 637.
https://android.googlesource.com/platform/external/dhcpcd/+/master/configure.c
Diffstat (limited to 'src/gudev')
0 files changed, 0 insertions, 0 deletions