Browse Source

mwan3: add logging for ipset errors

Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
lilik-openwrt-22.03
Aaron Goodman 4 years ago
parent
commit
99b4b3a178
1 changed files with 10 additions and 5 deletions
  1. +10
    -5
      net/mwan3/files/lib/mwan3/mwan3.sh

+ 10
- 5
net/mwan3/files/lib/mwan3/mwan3.sh View File

@ -153,7 +153,8 @@ mwan3_set_connected_ipv4()
{
local connected_network_v4 candidate_list cidr_list
$IPS -! create mwan3_connected_v4 hash:net
$IPS create mwan3_connected_v4_temp hash:net
$IPS create mwan3_connected_v4_temp hash:net ||
LOG notice "failed to create ipset mwan3_connected_v4_temp"
candidate_list=""
cidr_list=""
@ -178,10 +179,13 @@ mwan3_set_connected_ipv4()
$IPS -! add mwan3_connected_v4_temp "$connected_network_v4"
done
$IPS add mwan3_connected_v4_temp 224.0.0.0/3
$IPS add mwan3_connected_v4_temp 224.0.0.0/3 ||
LOG notice "failed to add 224.0.0.0/3 to mwan3_connected_v4_temp"
$IPS swap mwan3_connected_v4_temp mwan3_connected_v4
$IPS destroy mwan3_connected_v4_temp
$IPS swap mwan3_connected_v4_temp mwan3_connected_v4 ||
LOG notice "failed to swap mwan3_connected_v4_temp and mwan3_connected_v4"
$IPS destroy mwan3_connected_v4_temp ||
LOG notice "failed to destroy ipset mwan3_connected_v4_temp"
$IPS -! add mwan3_connected mwan3_connected_v4
}
@ -517,7 +521,8 @@ mwan3_delete_iface_ipset_entries()
for setname in $(ipset -n list | grep ^mwan3_sticky_); do
for entry in $(ipset list "$setname" | grep "$(mwan3_id2mask id MMX_MASK | awk '{ printf "0x%08x", $1; }')" | cut -d ' ' -f 1); do
$IPS del "$setname" $entry
$IPS del "$setname" $entry ||
LOG notice "failed to delete $entry from $setname"
done
done
}


Loading…
Cancel
Save