Skip to content

Commit 1b9a70c

Browse files
authored
Merge pull request #84 from openNDS/4.1.0beta
4.1.0beta
2 parents dda7ed9 + afc26c7 commit 1b9a70c

File tree

3 files changed

+47
-29
lines changed

3 files changed

+47
-29
lines changed

ChangeLog

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
mesh11sd (4.1.0)
2+
* Add - cli option dhcp4_renew [bluewavenet]
23
* Add - default owe transition mode [bluewavenet]
34
* Add - support for mesh_gate_encryption 4 (opportunistic wireless encryption, owe) [bluewavenet]
45
* Fix - odhcp6c option -p does not work so work around using ps utility [bluewavenet]
@@ -11,7 +12,7 @@ mesh11sd (4.1.0)
1112
* Fix - replace hardcoded iface with variable [qosmio]
1213
* Fix - mesh_id and mesh_key config keys [royallthefourth]
1314

14-
-- Rob White <dot@blue-wave.net> Fri, 19 July 2024 19:03:16 +0000
15+
-- Rob White <dot@blue-wave.net> Sat, 20 July 2024 12:25:08 +0000
1516

1617
mesh11sd (4.0.1)
1718
* Fix - indentation in README.md [bluewavenet]

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,10 @@ Mesh11sd is an OpenWrt service daemon and runs continuously in the background. I
752752
Usage: mesh11sd opkg_revert_to_default
753753
Reverts opkg to default for its downloads
754754

755+
Option: dhcp4_renew
756+
Usage: mesh11sd dhcp4_renew
757+
Renews the current dhcp4 lease
758+
755759
**Example status output:**
756760

757761
```

src/mesh11sd

+41-28
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#
1313
# mesh11sd daemon
1414
#
15-
version="4.1.0beta"
15+
version="4.1.0"
1616
fixup1=0
1717
ip4pingfailcount=0
1818
network_restart=0
@@ -1779,7 +1779,7 @@ auto_config() {
17791779
fi
17801780
else
17811781
debugtype="err"
1782-
syslogmessage="Unable to autoconfigure. Please install package wpad-mesh-mbedtls, wpad-mesh-wolfssl, wpad-mesh-openssl or an equivalent full version"
1782+
syslogmessage="Unable to autoconfigure. Please install package wpad-mbedtls, wpad-wolfssl, wpad-openssl or an equivalent mesh only version"
17831783
write_to_syslog
17841784
exit 1
17851785
fi
@@ -2234,6 +2234,10 @@ if [ -z "$1" ] || [ "$1" = "-h" ] || [ $1 = "--help" ] || [ $1 = "help" ]; then
22342234
Usage: mesh11sd opkg_revert_to_default
22352235
Reverts opkg to default for its downloads
22362236
2237+
Option: dhcp4_renew
2238+
Usage: mesh11sd dhcp4_renew
2239+
Renews the current dhcp4 lease
2240+
22372241
For further documentation, see: https://github.com/openNDS/mesh11sd#readme
22382242
22392243
"
@@ -2894,6 +2898,11 @@ elif [ "$1" = "opkg_revert_to_default" ]; then
28942898
28952899
exit 0
28962900
2901+
elif [ "$1" = "dhcp4_renew" ]; then
2902+
dhcpdevice=$(echo "get network.$auto_mesh_network.device" | uci batch | awk '{printf "%s", $1}')
2903+
dhcp4_renew
2904+
exit 0
2905+
28972906
elif [ "$1" = "daemon" ]; then
28982907
debugtype="notice"
28992908
syslogmessage="mesh11sd is in startup"
@@ -2917,6 +2926,36 @@ elif [ "$1" = "daemon" ]; then
29172926
uci revert network
29182927
uci revert firewall
29192928
2929+
# Check the configured ipv4 address and change it if left at default of 192.168.1.1
2930+
# For now, only chack in CPE mode.
2931+
# Possibly make this active for portal devices (via config option?)
2932+
setipaddr=$(uci get network.lan.ipaddr)
2933+
2934+
if [ "$setipaddr" = "192.168.1.1" ] && [ "$portal_detect" -eq 3 ]; then
2935+
. $tmpdir/devicemac
2936+
2937+
for i in $(seq 9 1 64); do
2938+
#choose start point of sequence away from end eg "9"
2939+
cpipsubnet=$((0x$(printf "$devicemac" | sha256sum | awk '{printf $1}' | tail -c$i | head -c2)))
2940+
2941+
#Check for max
2942+
if [ $cpipsubnet -ge 255 ];then
2943+
continue
2944+
fi
2945+
2946+
#Skip 168, 167, 0
2947+
if [ $cpipsubnet -eq 168 ] || [ $cpipsubnet -eq 167 ] || [ $cpipsubnet -eq 0 ];then
2948+
continue
2949+
fi
2950+
2951+
break
2952+
done
2953+
2954+
newipaddr="192.168.$cpipsubnet.1"
2955+
echo "set network.lan.ipaddr='$newipaddr'" | uci batch
2956+
fi
2957+
2958+
29202959
# Before restarting the network, check if CPE mode is requested
29212960
if [ "$portal_detect" -eq 3 ]; then
29222961
#CPE mode, so setup network config accordingly
@@ -2935,32 +2974,6 @@ elif [ "$1" = "daemon" ]; then
29352974
uci set network.wan.device='br-wan'
29362975
uci set network.wan6.device='br-wan'
29372976
2938-
setipaddr=$(uci get network.lan.ipaddr)
2939-
2940-
if [ "$setipaddr" = "192.168.1.1" ]; then
2941-
. $tmpdir/devicemac
2942-
2943-
for i in $(seq 9 1 64); do
2944-
#choose start point of sequence away from end eg "9"
2945-
cpipsubnet=$((0x$(printf "$devicemac" | sha256sum | awk '{printf $1}' | tail -c$i | head -c2)))
2946-
2947-
#Check for max
2948-
if [ $cpipsubnet -ge 255 ];then
2949-
continue
2950-
fi
2951-
2952-
#Skip 168, 167, 0
2953-
if [ $cpipsubnet -eq 168 ] || [ $cpipsubnet -eq 167 ] || [ $cpipsubnet -eq 0 ];then
2954-
continue
2955-
fi
2956-
2957-
break
2958-
done
2959-
2960-
newipaddr="192.168.$cpipsubnet.1"
2961-
echo "set network.lan.ipaddr='$newipaddr'" | uci batch
2962-
fi
2963-
29642977
# Refresh the ipaddr
29652978
setipaddr=$(uci get network.lan.ipaddr)
29662979

0 commit comments

Comments
 (0)