In some 4G network (LTE/WiMAX), the dhcp server will assign the netmask between the gateway to the client as "255.255.255.255". This patch fix the default script which cannot handle this situation which lead the default route could not be established because lack the routing entry of 4G NIC.
Signed-off-by: Macpaul Lin <macp...@gmail.com> --- .../files/usr/share/udhcpc/default.script | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/package/base-files-network/files/usr/share/udhcpc/default.script b/package/base-files-network/files/usr/share/udhcpc/default.script index 8dbff47..b6ae4ec 100755 --- a/package/base-files-network/files/usr/share/udhcpc/default.script +++ b/package/base-files-network/files/usr/share/udhcpc/default.script @@ -48,6 +48,11 @@ setup_interface () { change_state network "$ifc" ipaddr "$ip" change_state network "$ifc" broadcast "${broadcast:-+}" change_state network "$ifc" netmask "${subnet:-255.255.255.0}" + + [ -n "router" ] && [ "${subnet-255.255.255.0}" = "255.255.255.255" ] && { + echo "udhcpc: setting direct route of $interface" + route add -net $router netmask ${subnet:-255.255.255.0} dev $interface + } } -- 1.7.5.4 _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel