Skip to content

Commit

Permalink
Merge pull request #84 from openNDS/4.1.0beta
Browse files Browse the repository at this point in the history
4.1.0beta
  • Loading branch information
bluewavenet authored Jul 20, 2024
2 parents dda7ed9 + afc26c7 commit 1b9a70c
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 29 deletions.
3 changes: 2 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
mesh11sd (4.1.0)
* Add - cli option dhcp4_renew [bluewavenet]
* Add - default owe transition mode [bluewavenet]
* Add - support for mesh_gate_encryption 4 (opportunistic wireless encryption, owe) [bluewavenet]
* Fix - odhcp6c option -p does not work so work around using ps utility [bluewavenet]
Expand All @@ -11,7 +12,7 @@ mesh11sd (4.1.0)
* Fix - replace hardcoded iface with variable [qosmio]
* Fix - mesh_id and mesh_key config keys [royallthefourth]

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

mesh11sd (4.0.1)
* Fix - indentation in README.md [bluewavenet]
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,10 @@ Mesh11sd is an OpenWrt service daemon and runs continuously in the background. I
Usage: mesh11sd opkg_revert_to_default
Reverts opkg to default for its downloads

Option: dhcp4_renew
Usage: mesh11sd dhcp4_renew
Renews the current dhcp4 lease

**Example status output:**

```
Expand Down
69 changes: 41 additions & 28 deletions src/mesh11sd
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#
# mesh11sd daemon
#
version="4.1.0beta"
version="4.1.0"
fixup1=0
ip4pingfailcount=0
network_restart=0
Expand Down Expand Up @@ -1779,7 +1779,7 @@ auto_config() {
fi
else
debugtype="err"
syslogmessage="Unable to autoconfigure. Please install package wpad-mesh-mbedtls, wpad-mesh-wolfssl, wpad-mesh-openssl or an equivalent full version"
syslogmessage="Unable to autoconfigure. Please install package wpad-mbedtls, wpad-wolfssl, wpad-openssl or an equivalent mesh only version"
write_to_syslog
exit 1
fi
Expand Down Expand Up @@ -2234,6 +2234,10 @@ if [ -z "$1" ] || [ "$1" = "-h" ] || [ $1 = "--help" ] || [ $1 = "help" ]; then
Usage: mesh11sd opkg_revert_to_default
Reverts opkg to default for its downloads
Option: dhcp4_renew
Usage: mesh11sd dhcp4_renew
Renews the current dhcp4 lease
For further documentation, see: https://github.com/openNDS/mesh11sd#readme
"
Expand Down Expand Up @@ -2894,6 +2898,11 @@ elif [ "$1" = "opkg_revert_to_default" ]; then
exit 0
elif [ "$1" = "dhcp4_renew" ]; then
dhcpdevice=$(echo "get network.$auto_mesh_network.device" | uci batch | awk '{printf "%s", $1}')
dhcp4_renew
exit 0
elif [ "$1" = "daemon" ]; then
debugtype="notice"
syslogmessage="mesh11sd is in startup"
Expand All @@ -2917,6 +2926,36 @@ elif [ "$1" = "daemon" ]; then
uci revert network
uci revert firewall
# Check the configured ipv4 address and change it if left at default of 192.168.1.1
# For now, only chack in CPE mode.
# Possibly make this active for portal devices (via config option?)
setipaddr=$(uci get network.lan.ipaddr)
if [ "$setipaddr" = "192.168.1.1" ] && [ "$portal_detect" -eq 3 ]; then
. $tmpdir/devicemac
for i in $(seq 9 1 64); do
#choose start point of sequence away from end eg "9"
cpipsubnet=$((0x$(printf "$devicemac" | sha256sum | awk '{printf $1}' | tail -c$i | head -c2)))
#Check for max
if [ $cpipsubnet -ge 255 ];then
continue
fi
#Skip 168, 167, 0
if [ $cpipsubnet -eq 168 ] || [ $cpipsubnet -eq 167 ] || [ $cpipsubnet -eq 0 ];then
continue
fi
break
done
newipaddr="192.168.$cpipsubnet.1"
echo "set network.lan.ipaddr='$newipaddr'" | uci batch
fi
# Before restarting the network, check if CPE mode is requested
if [ "$portal_detect" -eq 3 ]; then
#CPE mode, so setup network config accordingly
Expand All @@ -2935,32 +2974,6 @@ elif [ "$1" = "daemon" ]; then
uci set network.wan.device='br-wan'
uci set network.wan6.device='br-wan'
setipaddr=$(uci get network.lan.ipaddr)
if [ "$setipaddr" = "192.168.1.1" ]; then
. $tmpdir/devicemac
for i in $(seq 9 1 64); do
#choose start point of sequence away from end eg "9"
cpipsubnet=$((0x$(printf "$devicemac" | sha256sum | awk '{printf $1}' | tail -c$i | head -c2)))
#Check for max
if [ $cpipsubnet -ge 255 ];then
continue
fi
#Skip 168, 167, 0
if [ $cpipsubnet -eq 168 ] || [ $cpipsubnet -eq 167 ] || [ $cpipsubnet -eq 0 ];then
continue
fi
break
done
newipaddr="192.168.$cpipsubnet.1"
echo "set network.lan.ipaddr='$newipaddr'" | uci batch
fi
# Refresh the ipaddr
setipaddr=$(uci get network.lan.ipaddr)
Expand Down

0 comments on commit 1b9a70c

Please sign in to comment.