Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion package/network/config/netifd/files/lib/netifd/dhcp.script
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ setup_interface () {
# TODO: apply $broadcast

for i in $router; do
proto_add_ipv4_route "$i" 32 "" "$ip"
ip_net=$(ipcalc.sh $ip/$mask | grep "NETWORK" | awk -F '=' '{print $2}')
gw_net=$(ipcalc.sh $i/$mask | grep "NETWORK" | awk -F '=' '{print $2}')
if [ "$ip_net" != "$gw_net" ]; then
proto_add_ipv4_route "$i" 32 "" "$ip"
fi

proto_add_ipv4_route 0.0.0.0 0 "$i" "$ip"

for r in $CUSTOMROUTES; do
Expand Down