mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Fix MPTCP with DHCP
This commit is contained in:
parent
0aa73216f3
commit
35d3936816
2 changed files with 4 additions and 0 deletions
|
@ -59,6 +59,7 @@ interface_multipath_settings() {
|
||||||
ipaddr=$(ip -4 addr show dev $iface | grep inet | awk '{print $2}' | cut -d/ -f1 | tr -d "\n")
|
ipaddr=$(ip -4 addr show dev $iface | grep inet | awk '{print $2}' | cut -d/ -f1 | tr -d "\n")
|
||||||
gateway=$(ip -4 r list dev $iface | grep -v default | awk '/proto static/ {print $1}' | tr -d "\n")
|
gateway=$(ip -4 r list dev $iface | grep -v default | awk '/proto static/ {print $1}' | tr -d "\n")
|
||||||
[ -z "$gateway" ] && gateway=$(ubus call network.interface.$iface status | jsonfilter -e '@.route[0].nexthop' | tr -d "\n")
|
[ -z "$gateway" ] && gateway=$(ubus call network.interface.$iface status | jsonfilter -e '@.route[0].nexthop' | tr -d "\n")
|
||||||
|
[ -z "$gateway" ] && gateway=$(ubus call network.interface.$iface status | jsonfilter -e '@.inactive.route[0].nexthop' | tr -d "\n")
|
||||||
netmask=$(ip -4 addr show dev $iface | grep inet | awk '{print $2}' | cut -d/ -f2 | tr -d "\n")
|
netmask=$(ip -4 addr show dev $iface | grep inet | awk '{print $2}' | cut -d/ -f2 | tr -d "\n")
|
||||||
network=`ipcalc.sh $ipaddr $netmask | sed -n '/NETWORK=/{;s/.*=//;s/ .*//;p;}'`
|
network=`ipcalc.sh $ipaddr $netmask | sed -n '/NETWORK=/{;s/.*=//;s/ .*//;p;}'`
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -131,6 +131,9 @@ while true; do
|
||||||
if [ -z "$OMR_TRACKER_DEVICE_GATEWAY" ]; then
|
if [ -z "$OMR_TRACKER_DEVICE_GATEWAY" ]; then
|
||||||
OMR_TRACKER_DEVICE_GATEWAY=$(ubus call network.interface.$OMR_TRACKER_DEVICE status | jsonfilter -e '@.route[0].nexthop' | tr -d "\n")
|
OMR_TRACKER_DEVICE_GATEWAY=$(ubus call network.interface.$OMR_TRACKER_DEVICE status | jsonfilter -e '@.route[0].nexthop' | tr -d "\n")
|
||||||
fi
|
fi
|
||||||
|
if [ -z "$OMR_TRACKER_DEVICE_GATEWAY" ]; then
|
||||||
|
OMR_TRACKER_DEVICE_GATEWAY=$(ubus call network.interface.$OMR_TRACKER_DEVICE status | jsonfilter -e '@.inactive.route[0].nexthop' | tr -d "\n")
|
||||||
|
fi
|
||||||
|
|
||||||
# execute specific tracker
|
# execute specific tracker
|
||||||
if [ -n "$OMR_TRACKER_DEVICE_IP" ] && [ -n "$OMR_TRACKER_DEVICE_GATEWAY" ]; then
|
if [ -n "$OMR_TRACKER_DEVICE_IP" ] && [ -n "$OMR_TRACKER_DEVICE_GATEWAY" ]; then
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue