Skip to content

Commit

Permalink
Add routes for all interfaces even when multipath is off in /etc/init…
Browse files Browse the repository at this point in the history
….d/mptcp
  • Loading branch information
Ysurac committed Nov 22, 2024
1 parent f9e4c3c commit 660e84c
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions mptcp/files/etc/init.d/mptcp
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,41 @@ interface_multipath_settings() {
ip link set dev $iface txqueuelen 1000 > /dev/null 2>&1
fi
fi
if [ -z "$gateway" ] && [ -n "$network" ]; then
if [ "$(uci -q get openmptcprouter.settings.uci_route)" = "1" ]; then
uci -q batch <<-EOF >/dev/null
delete network.${config}_rule
set network.${config}_rule=rule
set network.${config}_rule.lookup=${id}
set network.${config}_rule.priority=0
set network.${config}_rule.src="${ipaddr}/32"
set network.${config}_rule.created=mptcp
delete network.${config}_route
set network.${config}_route=route
set network.${config}_route.interface=${config}
set network.${config}_route.target=${network}
set network.${config}_route.netmask=${netmask}
set network.${config}_route.table=${ip4table}
set network.${config}_route.created=mptcp
delete network.${config}_route_default
commit network
EOF
else
[ -n "$ipaddr" ] && [ -z "$(ip rule show from $ipaddr table $ip4table)" ] && ip rule add from $ipaddr table $ip4table pref 0
[ -z "$(ip rule show oif $iface table $ip4table)" ] && ip rule add oif $iface table $ip4table pref 0
ip route replace $network/$netmask dev $iface scope link metric $id $initcwrwnd >/dev/null 2>&1
ip route replace $network/$netmask dev $iface scope link table $ip4table $initcwrwnd >/dev/null 2>&1
#ip route flush cache $id >/dev/null 2>&1
fi

if [ "$txqueuelen" != "" ]; then
#ifconfig $iface txqueuelen $txqueuelen > /dev/null 2>&1
ip link set dev $iface txqueuelen $txqueuelen > /dev/null 2>&1
else
#ifconfig $iface txqueuelen 1000 > /dev/null 2>&1
ip link set dev $iface txqueuelen 1000 > /dev/null 2>&1
fi
fi
if [ "$(uci -q get openmptcprouter.settings.disable_ipv6)" != "1" ] && [ "$config" != "omr6in4" ]; then
# IPv6 Updates:
local ip6addr
Expand Down

0 comments on commit 660e84c

Please sign in to comment.