mirror of
				https://github.com/Telecominfraproject/wlan-ap.git
				synced 2025-10-31 10:28:06 +00:00 
			
		
		
		
	Compare commits
	
		
			1 Commits
		
	
	
		
			feeds_use_
			...
			WIFI-14896
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 341b0f57e2 | 
| @@ -1,107 +0,0 @@ | |||||||
| # Description: The Mesh11sd daemon expects the mesh interface name to follow the format 'mesh<index>'.  |  | ||||||
| # If it doesn't find this format, it attempts to set it in the UCI wireless configuration.  |  | ||||||
| # However, when operating in other modes such as AP, STA, or Ad-Hoc, the script was patched to remove  |  | ||||||
| # the mesh interface name from UCI. This process can lead to a race condition between the UI and Mesh11sd, |  | ||||||
| # resulting in stale interface name values. |  | ||||||
| # This patch resolves the issue by removing the setting of the interface name from the script, as it is  |  | ||||||
| # now managed through the UI, ensuring consistency and eliminating the race condition. |  | ||||||
|  |  | ||||||
| --- a/src/mesh11sd |  | ||||||
| +++ b/src/mesh11sd |  | ||||||
| @@ -387,45 +387,45 @@ elif [ "$1" = "daemon" ]; then |  | ||||||
|   |  | ||||||
|  		if [ $mode -eq 5 ]; then |  | ||||||
|  			# startup=4, statusmode=0, enabled=1 |  | ||||||
| +			syslogmessage="mesh11sd v$version has started: mesh management mode $mode" |  | ||||||
|  			startup=0 |  | ||||||
|  			statusmode=0 |  | ||||||
|  			mode=1 |  | ||||||
| -			syslogmessage="mesh11sd v$version has started: mesh management mode $mode" |  | ||||||
|   |  | ||||||
|  		elif [ $mode -eq 4 ]; then |  | ||||||
|  			# startup=4, statusmode=0, enabled=0 |  | ||||||
| +			syslogmessage="mesh11sd v$version has started: mesh status mode $mode" |  | ||||||
|  			startup=0 |  | ||||||
|  			statusmode=2 |  | ||||||
|  			mode=0 |  | ||||||
| -			syslogmessage="mesh11sd v$version has started: mesh status mode $mode" |  | ||||||
|   |  | ||||||
|  		elif [ $mode -eq 3 ]; then |  | ||||||
|  			# startup=0, statusmode=2, enabled=1 |  | ||||||
| +			syslogmessage="mesh11sd v$version has started: mesh management mode $mode" |  | ||||||
|  			startup=0 |  | ||||||
|  			statusmode=0 |  | ||||||
|  			mode=1 |  | ||||||
| -			syslogmessage="mesh11sd v$version has started: mesh management mode $mode" |  | ||||||
|   |  | ||||||
|  		elif [ $mode -eq 2 ]; then |  | ||||||
|  			# startup=0, statusmode=2, enabled=0 |  | ||||||
| +			syslogmessage="mesh11sd v$version has started: mesh status mode $mode" |  | ||||||
|  			startup=0 |  | ||||||
|  			statusmode=2 |  | ||||||
|  			mode=0 |  | ||||||
| -			syslogmessage="mesh11sd v$version has started: mesh status mode $mode" |  | ||||||
|   |  | ||||||
|  		elif [ $mode -eq 1 ]; then |  | ||||||
|  			# startup=0, statusmode=0, enabled=1 |  | ||||||
| +			syslogmessage="mesh11sd v$version has started, mesh management mode $mode" |  | ||||||
|  			startup=0 |  | ||||||
|  			statusmode=0 |  | ||||||
|  			mode=1 |  | ||||||
| -			syslogmessage="mesh11sd v$version has started, mesh management mode $mode" |  | ||||||
|   |  | ||||||
|  		elif [ $mode -eq 0 ]; then |  | ||||||
|  			# startup=0, statusmode=0, enabled=0 |  | ||||||
| +			syslogmessage="mesh11sd v$version has started: mesh status mode $mode" |  | ||||||
|  			startup=0 |  | ||||||
|  			statusmode=2 |  | ||||||
|  			mode=0 |  | ||||||
| -			syslogmessage="mesh11sd v$version has started: mesh status mode $mode" |  | ||||||
|  		fi |  | ||||||
|   |  | ||||||
|  		if [ $mode -ne $lastmode ]; then |  | ||||||
| @@ -441,26 +441,6 @@ elif [ "$1" = "daemon" ]; then |  | ||||||
|  			meshconfigs=$(uci show wireless 2> /dev/null | grep "mode='mesh'" | awk -F ".mode='mesh'" '{printf "%s " $1}') |  | ||||||
|   |  | ||||||
|  			if [ ! -z "$meshconfigs" ]; then |  | ||||||
| -				for meshconfig in $meshconfigs; do |  | ||||||
| -					ifname=$(uci get $meshconfig.ifname 2> /dev/null) |  | ||||||
| - |  | ||||||
| -					if [ -z "$ifname" ] || [ "$ifname" != "mesh$meshindex" ]; then |  | ||||||
| -						# No interface name in config, so add one |  | ||||||
| -						ucibatch="set $meshconfig.ifname='mesh$meshindex'" |  | ||||||
| -						echo "$ucibatch" | uci batch |  | ||||||
| -						changed=1 |  | ||||||
| -						syslogmessage="Setting mesh interface name to [ mesh$meshindex ]" |  | ||||||
| -						write_to_syslog |  | ||||||
| -					fi |  | ||||||
| -					meshindex=$(($meshindex+1)) |  | ||||||
| -				done |  | ||||||
| - |  | ||||||
| -				if [ "$changed" -eq 1 ]; then |  | ||||||
| -					changed=0 |  | ||||||
| -					restart_mesh |  | ||||||
| -					continue |  | ||||||
| -				fi |  | ||||||
| - |  | ||||||
|  				# get a list of interfaces |  | ||||||
|  				get_mesh_iflist |  | ||||||
|   |  | ||||||
| @@ -482,13 +462,13 @@ elif [ "$1" = "daemon" ]; then |  | ||||||
|  						# this is not a mesh interface |  | ||||||
|  						continue |  | ||||||
|  					else |  | ||||||
| -						# Check if this interface has a uci ifname |  | ||||||
| -						uciname=$(uci show wireless | grep "ifname='$iface'" | awk -F "." '{printf "wireless.%s" $2}') |  | ||||||
| +						# Check if this interface mode is 'mesh' |  | ||||||
| +						uciname=$(uci show wireless | grep "mode='mesh'" | awk -F "." '{printf "wireless.%s" $2}') |  | ||||||
|   |  | ||||||
|  						if [ -z "$uciname" ]; then |  | ||||||
| -							# Error - No interface name in config, we should have added one |  | ||||||
| +							# Error - No interface with mode as mesh |  | ||||||
|  							debugtype="err" |  | ||||||
| -							syslogmessage="Error getting mesh interface name" |  | ||||||
| +							syslogmessage="Error getting mesh interface section" |  | ||||||
|  							write_to_syslog |  | ||||||
|  							continue |  | ||||||
|  						fi |  | ||||||
| @@ -0,0 +1,63 @@ | |||||||
|  | # Description: The Mesh11sd daemon sets the interface name 'mesh<index>' to the mesh interface. | ||||||
|  | # However, even after disabling the mesh mode, this interface name persists, leading to confusion | ||||||
|  | # when operating in other modes like AP/STA/Ad-Hoc, where the interface name continues to display as 'mesh<idx>'. | ||||||
|  | # This patch addresses the issue by removing the 'mesh<idx>' interface name from the configuration when the device | ||||||
|  | # is no longer in mesh mode. As this modification is not present in the upstream version, it is necessary to apply | ||||||
|  | # this local patch to resolve the inconsistency | ||||||
|  |  | ||||||
|  | diff --git a/src/mesh11sd b/src/mesh11sd | ||||||
|  | index 85041d3..5f50e97 100755 | ||||||
|  | --- a/src/mesh11sd | ||||||
|  | +++ b/src/mesh11sd | ||||||
|  | @@ -387,45 +387,45 @@ elif [ "$1" = "daemon" ]; then | ||||||
|  |   | ||||||
|  |  		if [ $mode -eq 5 ]; then | ||||||
|  |  			# startup=4, statusmode=0, enabled=1 | ||||||
|  | +			syslogmessage="mesh11sd v$version has started: mesh management mode $mode" | ||||||
|  |  			startup=0 | ||||||
|  |  			statusmode=0 | ||||||
|  |  			mode=1 | ||||||
|  | -			syslogmessage="mesh11sd v$version has started: mesh management mode $mode" | ||||||
|  |   | ||||||
|  |  		elif [ $mode -eq 4 ]; then | ||||||
|  |  			# startup=4, statusmode=0, enabled=0 | ||||||
|  | +			syslogmessage="mesh11sd v$version has started: mesh status mode $mode" | ||||||
|  |  			startup=0 | ||||||
|  |  			statusmode=2 | ||||||
|  |  			mode=0 | ||||||
|  | -			syslogmessage="mesh11sd v$version has started: mesh status mode $mode" | ||||||
|  |   | ||||||
|  |  		elif [ $mode -eq 3 ]; then | ||||||
|  |  			# startup=0, statusmode=2, enabled=1 | ||||||
|  | +			syslogmessage="mesh11sd v$version has started: mesh management mode $mode" | ||||||
|  |  			startup=0 | ||||||
|  |  			statusmode=0 | ||||||
|  |  			mode=1 | ||||||
|  | -			syslogmessage="mesh11sd v$version has started: mesh management mode $mode" | ||||||
|  |   | ||||||
|  |  		elif [ $mode -eq 2 ]; then | ||||||
|  |  			# startup=0, statusmode=2, enabled=0 | ||||||
|  | +			syslogmessage="mesh11sd v$version has started: mesh status mode $mode" | ||||||
|  |  			startup=0 | ||||||
|  |  			statusmode=2 | ||||||
|  |  			mode=0 | ||||||
|  | -			syslogmessage="mesh11sd v$version has started: mesh status mode $mode" | ||||||
|  |   | ||||||
|  |  		elif [ $mode -eq 1 ]; then | ||||||
|  |  			# startup=0, statusmode=0, enabled=1 | ||||||
|  | +			syslogmessage="mesh11sd v$version has started, mesh management mode $mode" | ||||||
|  |  			startup=0 | ||||||
|  |  			statusmode=0 | ||||||
|  |  			mode=1 | ||||||
|  | -			syslogmessage="mesh11sd v$version has started, mesh management mode $mode" | ||||||
|  |   | ||||||
|  |  		elif [ $mode -eq 0 ]; then | ||||||
|  |  			# startup=0, statusmode=0, enabled=0 | ||||||
|  | +			syslogmessage="mesh11sd v$version has started: mesh status mode $mode" | ||||||
|  |  			startup=0 | ||||||
|  |  			statusmode=2 | ||||||
|  |  			mode=0 | ||||||
|  | -			syslogmessage="mesh11sd v$version has started: mesh status mode $mode" | ||||||
|  |  		fi | ||||||
|  |   | ||||||
|  |  		if [ $mode -ne $lastmode ]; then | ||||||
| @@ -0,0 +1,39 @@ | |||||||
|  | --- a/src/mesh11sd	2024-09-06 17:13:52.075070001 +0800 | ||||||
|  | +++ b/src/mesh11sd	2024-09-06 17:47:36.326914438 +0800 | ||||||
|  | @@ -434,7 +434,6 @@ | ||||||
|  |  		fi | ||||||
|  |   | ||||||
|  |  		lastmode=$mode | ||||||
|  | -		meshindex=0 | ||||||
|  |   | ||||||
|  |  		if [ "$enabled" = 1 ]; then | ||||||
|  |  			#get list of mesh configs | ||||||
|  | @@ -443,16 +442,19 @@ | ||||||
|  |  			if [ ! -z "$meshconfigs" ]; then | ||||||
|  |  				for meshconfig in $meshconfigs; do | ||||||
|  |  					ifname=$(uci get $meshconfig.ifname 2> /dev/null) | ||||||
|  | - | ||||||
|  | -					if [ -z "$ifname" ] || [ "$ifname" != "mesh$meshindex" ]; then | ||||||
|  | -						# No interface name in config, so add one | ||||||
|  | -						ucibatch="set $meshconfig.ifname='mesh$meshindex'" | ||||||
|  | -						echo "$ucibatch" | uci batch | ||||||
|  | -						changed=1 | ||||||
|  | -						syslogmessage="Setting mesh interface name to [ mesh$meshindex ]" | ||||||
|  | -						write_to_syslog | ||||||
|  | +					device=$(uci -q get $meshconfig.device) | ||||||
|  | +					device_type=$(uci -q get wireless.$device.type) | ||||||
|  | +					new_ifname="halow_mesh" | ||||||
|  | +					if [ "$device_type" == "morse" ]; then | ||||||
|  | +						if [ -z "$ifname" ] || [ "$ifname" != "$new_ifname" ]; then | ||||||
|  | +							# No interface name in config, so add one | ||||||
|  | +							ucibatch="set $meshconfig.ifname='$new_ifname'" | ||||||
|  | +							echo "$ucibatch" | uci batch | ||||||
|  | +							changed=1 | ||||||
|  | +							syslogmessage="Setting mesh interface name to [ $new_ifname ]" | ||||||
|  | +							write_to_syslog | ||||||
|  | +						fi | ||||||
|  |  					fi | ||||||
|  | -					meshindex=$(($meshindex+1)) | ||||||
|  |  				done | ||||||
|  |   | ||||||
|  |  				if [ "$changed" -eq 1 ]; then | ||||||
| @@ -2,7 +2,7 @@ if PACKAGE_wpa_supplicant_s1g | |||||||
|  |  | ||||||
| 	config MORSE_WPA_SUPPLICANT_S1G_MESH_NETWORKING | 	config MORSE_WPA_SUPPLICANT_S1G_MESH_NETWORKING | ||||||
| 		bool | 		bool | ||||||
| 		default n | 		default y | ||||||
| 		prompt "Enable mesh networking support" | 		prompt "Enable mesh networking support" | ||||||
|  |  | ||||||
| 	config MORSE_WPA_SUPPLICANT_S1G_EAP | 	config MORSE_WPA_SUPPLICANT_S1G_EAP | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user