Skip to content

Commit 2917062

Browse files
committed
Support WPA in IBSS mode
Add 'wpa_supplicant_ibss.conf' to configure the IBSS network. Add a check for the existence of the bssid parameter in 'vwifi_join_ibss' to support the system-generated BSSID. Modify 'vw3' and 'vw4' in the test script 'verify.sh' to enter 'ibss1' using WPA.
1 parent bd35301 commit 2917062

File tree

3 files changed

+22
-13
lines changed

3 files changed

+22
-13
lines changed

scripts/verify.sh

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -160,21 +160,19 @@ if [ $final_ret -eq 0 ]; then
160160
final_ret=7
161161
fi
162162

163-
# vw3 becomes an IBSS and then joins the "ibss1" network (BSSID: 00:76:77:33:00:00).
163+
# vw3 becomes an IBSS and then joins the "ibss1" network.
164164
echo
165-
echo "=================================="
166-
echo "vw3 join ibss1 (00:76:77:33:00:00)"
167-
echo "=================================="
168-
sudo ip netns exec ns3 iw dev vw3 set type ibss
169-
sudo ip netns exec ns3 iw dev vw3 ibss join ibss1 2412 NOHT fixed-freq 00:76:77:33:00:00 beacon-interval 200
165+
echo "=============="
166+
echo "vw3 join ibss1"
167+
echo "=============="
168+
sudo ip netns exec ns3 wpa_supplicant -i vw3 -B -c scripts/wpa_supplicant_ibss.conf
170169

171-
# vw4 becomes an IBSS and then joins the "ibss1" network (BSSID: 00:76:77:33:00:00).
170+
# vw4 becomes an IBSS and then joins the "ibss1" network.
172171
echo
173-
echo "=================================="
174-
echo "vw4 join ibss1 (00:76:77:33:00:00)"
175-
echo "=================================="
176-
sudo ip netns exec ns4 iw dev vw4 set type ibss
177-
sudo ip netns exec ns4 iw dev vw4 ibss join ibss1 2412 NOHT fixed-freq 00:76:77:33:00:00 beacon-interval 200
172+
echo "=============="
173+
echo "vw4 join ibss1"
174+
echo "=============="
175+
sudo ip netns exec ns4 wpa_supplicant -i vw4 -B -c scripts/wpa_supplicant_ibss.conf
178176

179177
# vw5 becomes an IBSS and then joins the "ibss2" network (BSSID: 00:76:77:35:00:00).
180178
echo

scripts/wpa_supplicant_ibss.conf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
network={
2+
ssid="ibss1"
3+
mode=1
4+
frequency=2412
5+
key_mgmt=WPA-PSK
6+
proto=RSN
7+
pairwise=CCMP
8+
group=CCMP
9+
psk="12345678"
10+
}

vwifi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2074,7 +2074,8 @@ static int vwifi_join_ibss(struct wiphy *wiphy,
20742074
return -ERESTARTSYS;
20752075
/* Retrieve IBSS configuration parameters */
20762076
memcpy(vif->ssid, params->ssid, params->ssid_len);
2077-
memcpy(vif->bssid, params->bssid, ETH_ALEN);
2077+
if (params->bssid)
2078+
memcpy(vif->bssid, params->bssid, ETH_ALEN);
20782079
vif->ibss_chandef = params->chandef;
20792080
vif->ssid_len = params->ssid_len;
20802081
vif->beacon_ie_len = params->ie_len;

0 commit comments

Comments
 (0)