[PATCH] fff-hoods: manually create wifi station interface

Fabian Bläse fabian at blaese.de
Mo Jan 6 00:53:37 CET 2020


Oh man. Dieses Thunderbird ist so kaputt.. Ich versuchs nochmal:

On 05.01.20 23:17, mail at adrianschmutzler.de wrote:
>> diff --git a/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile
>> b/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile
>> index b148eca..d9119ac 100644
>> --- a/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile
>> +++ b/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile
>> @@ -15,29 +15,33 @@ getWirelessHoodfile() {
>>
>>  	# Set channel to auto, enable wXsta, disable other interfaces
>>  	for radio in $(wifiListRadio); do
>> -		uci set "wireless.${radio}.channel=auto"
>> -
>>  		freq="$(wifiGetFreq $radio)"
>>  		uci set wireless.w${freq}ap.disabled='1'
>>  		uci set wireless.w${freq}mesh.disabled='1'
>>  		uci set wireless.w${freq}configap.disabled='1'
>> -		uci set wireless.w${freq}sta.disabled='0'
>>  	done
>>
>>  	uci commit wireless
>>  	reload_config
>>
>> -	wifi
>> -	# wait a moment to start the interface
>> -	sleep 10;
>> +	# wait for wireless interfaces to vanish
>> +	sleep 5;
>>
>> -	if /bin/busybox wget -T15 -O "$file"
>> "http://[fe80::1%w2sta]:2342/keyxchangev2data"; then
>> -		return 0
>> -	elif /bin/busybox wget -T15 -O "$file"
>> "http://[fe80::1%w5sta]:2342/keyxchangev2data"; then
>> -		return 0
>> -	else
>> -		return 1
>> -	fi
>> +
>> +	for phy in $(ls /sys/class/ieee80211); do
>> +		iw phy $phy interface add configsta type managed
>> +		ip link set up configsta
>> +		iw dev configsta connect -w config.franken.freifunk.net
>> 2>/dev/null
>> +
>> +		if /bin/busybox wget -T15 -O "$file"
>> "http://[fe80::1%configsta]:2342/keyxchangev2data"; then
>> +			iw dev configsta del
>> +			return 0
>> +		fi
>> +
>> +		iw dev configsta del
> 
> Brauchen wir da vorher noch sowas wie "ip link set down configsta" oder macht das iw automatisch mit? Nicht, dass da irgendwelche Leichen übrig bleiben.
Ne. "ip link set" setzt nur den administrative link state eines Interfaces, der ein Interface administrativ ein- oder ausschaltet. Das Interface wird von iw im Kernel angelegt und bei "iw dev <dev> del" wieder entfernt. Dann ist es vollständig weg und hat daher auch keinen administrative link state mehr.

> Außerdem:
> In configurehood gibt es noch eine Zeile, die das wXsta im Erfolgsfall wieder ausmacht. Die müsstest du auch noch löschen.
Das stimmt. Ich warte mal noch auf weiteres Feedback, bevor ich das ändere.

Gruß
Fabian


Mehr Informationen über die Mailingliste franken-dev