Connect to wifi with bash script - bash

I've created a bash script that is supposed to connect to WiFi dynamically. Whether it is WPA, WEP, without password, with static ip or using DHCP.
There is the script:
#!/bin/bash
echo "Open script..."
#NO PASSWORD
if [ $3 == 0 ]
then
echo "Without Password..."
iw dev wlan0 connect $1
fi
if [ $3 == "WEP" ]
then
echo "Auth mode WEP..."
iw wlan0 connect $1 key s:$2
fi
if [ $3 == "WPA" ] || [ $3 == "WPA2" ]
then
echo "Auth mode WPA"
echo "ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid=\"$1\"
psk=\"$2\"
}" | sudo tee --append /etc/wpa_supplicant/wpa_supplicant.conf >
/dev/null
echo "Finished to write on wpa supplicant..."
sudo wpa_supplicant -B -i wlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf -Dwext
fi
if [ $4 == "DHCP" ]
then
echo "dhcp mode on..."
dhclient wlan0
else
echo "dhcp mode off..."
#ifconfig wlan0 $5 netmask $6 up
#route add default gw $7
#echo "nameserver $8">/etc/resolv.conf
fi
#SET DNS 2
if [ $9 != 0 ]
then
echo "dn2 configuration..."
#echo "nameserver $8">/etc/resolv.conf
fi
#RESTART UP
echo "restarting process..."
#ifconfig eth0 down
#/etc/init.d/networking restart
#pm2 stop 0
#pm2 delete 0
#pm2 start ecosystem.json
That's all. Some commands are commented because it is not finished yet. My problem is that the script isn't working. I gave it permissions on wpa_supplicant.conf, but it still does not want to work.
My errors are:
Finish to write on wpa_supplicant...
Successfully initialized wpa_supplicant
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
dhcp mode on...
restarting process...
stderr RTNETLINK answers: Operation not permitted
All variables work fine when I run the script, but somehow it still can't connect to WiFi. I've tried to use nl80211 instead and it gives me this error:
Failed to create interface
p2p-dev-wlan0: -16 (Device or resource busy) nl80211: Failed to create
a P2P Device interface p2p-dev-wlan0 P2P: Failed to enable P2P Device
interface
More verbose errors:
nl80211: TDLS supported
nl80211: Supported cipher 00-0f-ac:1
nl80211: Supported cipher 00-0f-ac:5
nl80211: Supported cipher 00-0f-ac:2
nl80211: Supported cipher 00-0f-ac:4
nl80211: Using driver-based off-channel TX
nl80211: Supported vendor command: vendor_id=0x1018 subcmd=1
nl80211: Use separate P2P group interface (driver advertised support)
nl80211: use P2P_DEVICE support
nl80211: interface wlan0 in phy phy0
nl80211: Set mode ifindex 3 iftype 2 (STATION)
nl80211: Subscribe to mgmt frames with non-AP handle 0x1b9f4a0
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION)
nl_handle=0x1b9f4a0 match=040a
nl80211: Register frame command failed (type=208): ret=-114 (Operation
already in progress)
nl80211: Register frame match - hexdump(len=2): 04 0a
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION)
nl_handle=0x1b9f4a0 match=040b
nl80211: Register frame command failed (type=208): ret=-114 (Operation
already in progress)
nl80211: Register frame match - hexdump(len=2): 04 0b
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION)
nl_handle=0x1b9f4a0 match=040c
nl80211: Register frame command failed (type=208): ret=-114 (Operation
already in progress)
nl80211: Register frame match - hexdump(len=2): 04 0c
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION)
nl_handle=0x1b9f4a0 match=040d
nl80211: Register frame command failed (type=208): ret=-114 (Operation
already in progress)
nl80211: Register frame match - hexdump(len=2): 04 0d
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION)
nl_handle=0x1b9f4a0 match=090a
nl80211: Register frame command failed (type=208): ret=-114 (Operation
already in progress)
nl80211: Register frame match - hexdump(len=2): 09 0a
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION)
nl_handle=0x1b9f4a0 match=090b
nl80211: Register frame command failed (type=208): ret=-114 (Operation
already in progress)
nl80211: Register frame match - hexdump(len=2): 09 0b
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION)
nl_handle=0x1b9f4a0 match=090c
nl80211: Register frame command failed (type=208): ret=-114 (Operation
already in progress)
nl80211: Register frame match - hexdump(len=2): 09 0c
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION)
nl_handle=0x1b9f4a0 match=090d
nl80211: Register frame command failed (type=208): ret=-114 (Operation
already in progress)
nl80211: Register frame match - hexdump(len=2): 09 0d
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION)
nl_handle=0x1b9f4a0 match=0409506f9a09
nl80211: Register frame command failed (type=208): ret=-114 (Operation
already in progress)
nl80211: Register frame match - hexdump(len=6): 04 09 50 6f 9a 09
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION)
nl_handle=0x1b9f4a0 match=7f506f9a09
nl80211: Register frame command failed (type=208): ret=-114 (Operation
already in progress)
nl80211: Register frame match - hexdump(len=5): 7f 50 6f 9a 09
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION)
nl_handle=0x1b9f4a0 match=0801
nl80211: Register frame command failed (type=208): ret=-114 (Operation
already in progress)
nl80211: Register frame match - hexdump(len=2): 08 01
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION)
nl_handle=0x1b9f4a0 match=040e
nl80211: Register frame command failed (type=208): ret=-114 (Operation
already in progress)
nl80211: Register frame match - hexdump(len=2): 04 0e
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION)
nl_handle=0x1b9f4a0 match=06
nl80211: Register frame command failed (type=208): ret=-114 (Operation
already in progress)
nl80211: Register frame match - hexdump(len=1): 06
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x1b9f4a0 match=0a07
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 0a 07
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x1b9f4a0 match=0a11
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 0a 11
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x1b9f4a0 match=1101
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 11 01
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x1b9f4a0 match=1102
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 11 02
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x1b9f4a0 match=0505
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 05 05
nl80211: Failed to register Action frame processing - ignore for now
netlink: Operstate: ifindex=3 linkmode=1 (userspace-control), operstate=5 (IF_OPER_DORMANT)
nl80211: driver param='(null)'
Add interface wlan0 to a new radio phy0
nl80211: Regulatory information - country=00
nl80211: 2402-2472 # 40 MHz 20 mBm
nl80211: 2457-2482 # 20 MHz 20 mBm (no IR)
nl80211: 2474-2494 # 20 MHz 20 mBm (no OFDM) (no IR)
nl80211: 5170-5250 # 80 MHz 20 mBm (no IR)
nl80211: 5250-5330 # 80 MHz 20 mBm (DFS) (no IR)
nl80211: 5490-5730 # 160 MHz 20 mBm (DFS) (no IR)
nl80211: 5735-5835 # 80 MHz 20 mBm (no IR)
nl80211: 57240-63720 # 2160 MHz 0 mBm
nl80211: Added 802.11b mode based on 802.11g information
wlan0: Own MAC address: b8:27:eb:d0:13:64
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=0 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=1 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=2 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=3 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=4 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=5 set_tx=0 seq_len=0 key_len=0
wlan0: RSN: flushing PMKID list in the driver
nl80211: Flush PMKIDs
TDLS: TDLS operation supported by driver
TDLS: Driver uses internal link setup
TDLS: Driver does not support TDLS channel switching
wlan0: WPS: UUID based on MAC address: 7630b69b-9582-57c5-9979-4b06864bafb4
ENGINE: Loading dynamic engine
ENGINE: Loading dynamic engine
EAPOL: SUPP_PAE entering state DISCONNECTED
EAPOL: Supplicant port status: Unauthorized
nl80211: Skip set_supp_port(unauthorized) while not associated
EAPOL: KEY_RX entering state NO_KEY_RECEIVE
EAPOL: SUPP_BE entering state INITIALIZE
EAP: EAP entering state DISABLED
Using existing control interface directory.
ctrl_interface_group=108 (from group name 'netdev')
wlan0: Added interface wlan0
wlan0: State: DISCONNECTED -> DISCONNECTED
nl80211: Set wlan0 operstate 0->0 (DORMANT)
netlink: Operstate: ifindex=3 linkmode=-1 (no change), operstate=5 (IF_OPER_DORMANT)
nl80211: Create interface iftype 10 (P2P_DEVICE)
Failed to create interface p2p-dev-wlan0: -16 (Device or resource busy)
nl80211: Failed to create a P2P Device interface p2p-dev-wlan0
P2P: Failed to create P2P Device interface
P2P: Failed to enable P2P Device interface
Daemonize..
dhcp mode on...
restarting process...
stderr RTNETLINK answers: Operation not permitted
Can someone help me?
Edit:
Wpa supplicant after running script:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=network
update_config=1
network={
ssid="WIFI"
psk="Password"
}
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="WIFI"
psk="Password"
}
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="WIFI"
psk="Password"
}
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="WIFI"
psk="Password"
}
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="WIFI"
psk="Password"
}
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="WIFI"
psk="Password"
}
I have just noticed that the same interface has been repeated several times, but it is due more to the fact that I have launched the script over and over again

Related

libssh2: `libssh2_channel_forward_listen_ex` returning "Unable to send global-request packet"

I am trying to do local port forwarding with libssh2.
I have a server (docker container) with openssh running a TCP echo service. I am using password login. I can ssh into the machine fine. I am able to use ssh -L 7894:127.0.0.1:1794 server to do port forwarding and the echo service works fine echoing back to netcat run with nc 127.0.0.1 7894 from my machine.
I am trying to write an application that uses libssh2 to replicate the above access to the TCP echo server.
libssh2_channel_forward_listen_ex fails with the error string set to "Unable to send global-request packet for forward listen request" and errno set to -7.
I have debugging enabled on openssh. Here is the tail of the log
2022-10-26 13:48:02.221353473 Accepted password for linuxserver.io from 172.17.0.1 port 59038 ssh2
2022-10-26 13:48:02.221354712 debug1: monitor_child_preauth: user linuxserver.io authenticated by privileged process
2022-10-26 13:48:02.221355826 debug3: mm_get_keystate: Waiting for new keys
2022-10-26 13:48:02.221356944 debug3: mm_request_receive_expect: entering, type 26
2022-10-26 13:48:02.221358009 debug3: mm_request_receive: entering
2022-10-26 13:48:02.225893485 debug3: mm_get_keystate: GOT new keys
2022-10-26 13:48:02.226000913 debug3: mm_auth_password: user authenticated [preauth]
2022-10-26 13:48:02.226070905 debug3: user_specific_delay: user specific delay 0.000ms [preauth]
2022-10-26 13:48:02.226164806 debug3: ensure_minimum_time_since: elapsed 3.936ms, delaying 4.139ms (requested 8.076ms) [preauth]
2022-10-26 13:48:02.226271865 debug3: send packet: type 52 [preauth]
2022-10-26 13:48:02.226375237 debug3: mm_request_send: entering, type 26 [preauth]
2022-10-26 13:48:02.226423116 debug3: mm_send_keystate: Finished sending state [preauth]
2022-10-26 13:48:02.226827341 debug1: monitor_read_log: child log fd closed
2022-10-26 13:48:02.227487840 debug3: ssh_sandbox_parent_finish: finished
2022-10-26 13:48:02.228021181 User child is on pid 266
2022-10-26 13:48:02.228839803 debug3: monitor_apply_keystate: packet_set_state
2022-10-26 13:48:02.229331154 debug2: ssh_set_newkeys: mode 0
2022-10-26 13:48:02.229740053 debug1: rekey in after 4294967296 blocks
2022-10-26 13:48:02.230150994 debug2: ssh_set_newkeys: mode 1
2022-10-26 13:48:02.230567267 debug1: rekey out after 4294967296 blocks
2022-10-26 13:48:02.231008444 debug1: ssh_packet_set_postauth: called
2022-10-26 13:48:02.231441309 debug3: ssh_packet_set_state: done
2022-10-26 13:48:02.231937248 debug3: notify_hostkeys: key 0: ssh-rsa SHA256:/7FFzlIP6gEuh52lzVrSDATTQFj4wnH5ScMtaH+NpHM
2022-10-26 13:48:02.232015182 debug3: notify_hostkeys: key 1: ecdsa-sha2-nistp256 SHA256:njZFCzAT2OFVE0n/kJ6YdOVCF7iPGjyZmy5Lr+3DE2E
2022-10-26 13:48:02.232069432 debug3: notify_hostkeys: key 2: ssh-ed25519 SHA256:YP702pqTQF410dCkQgOsWD/pz+MXoVNv5EzQnxklFD4
2022-10-26 13:48:02.232091834 debug3: notify_hostkeys: sent 3 hostkeys
2022-10-26 13:48:02.232108621 debug3: send packet: type 80
2022-10-26 13:48:02.232146882 debug1: active: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
2022-10-26 13:48:02.232166314 debug1: Entering interactive session for SSH2.
2022-10-26 13:48:02.232183856 debug1: server_init_dispatch
2022-10-26 13:48:02.232393938 Connection closed by 172.17.0.1 port 59038
2022-10-26 13:48:02.232422452 debug1: do_cleanup
2022-10-26 13:48:02.232439029 Transferred: sent 2096, received 1368 bytes
2022-10-26 13:48:02.232453748 Closing connection to 172.17.0.1 port 59038
2022-10-26 13:48:02.232524366 debug3: mm_request_send: entering, type 50
2022-10-26 13:48:02.232582535 debug3: mm_request_receive: entering
2022-10-26 13:48:02.232583894 debug3: monitor_read: checking request 50
2022-10-26 13:48:02.232585103 debug3: mm_answer_term: tearing down sessions
I also enabled debug tracing in libssh2. Here is the output from my application:
[libssh2] 0.225733 Conn: Requesting tcpip-forward session for 127.0.0.1:54814
[2022-10-26 08:48:02.226] [error] Failed to start the local-forward listener: Unable to send global-request packet for forward listen request (-7)
=> libssh2_transport_write plain (36 bytes)
0000: 50 00 00 00 0D 74 63 70 69 70 2D 66 6F 72 77 61 : P....tcpip-forwa
0010: 72 64 01 00 00 00 09 31 32 37 2E 30 2E 30 2E 31 : rd.....127.0.0.1
0020: 00 00 D6 1E : ....
[libssh2] 0.225763 Socket: Error sending 80 bytes: 9
[libssh2] 0.225765 Failure Event: -7 - Unable to send global-request packet for forward listen request
[libssh2] 0.225935 Transport: Disconnecting: reason=11, desc=Shutdown SSH session, lang=
=> libssh2_transport_write plain (33 bytes)
0000: 01 00 00 00 0B 00 00 00 14 53 68 75 74 64 6F 77 : .........Shutdow
0010: 6E 20 53 53 48 20 73 65 73 73 69 6F 6E 00 00 00 : n SSH session...
0020: 00 : .
=> libssh2_transport_write plain2 (0 bytes)
[libssh2] 0.225977 Socket: Error sending 80 bytes: 9
[libssh2] 0.225979 Transport: Freeing session resource
[libssh2] 0.225985 Transport: Extra packets left 0
[libssh2] 0.225987 Transport: unable to reset socket's blocking state
Process finished with exit code 1
I'd appreciate any help in resolving this!
Update:
Looks like Socket: Error sending 80 bytes: 9 is indicating a timeout error. I've tried adding libssh2_session_set_timeout(session, 0); but it did nothing.

PCI Express AER Driver issues on Linux

I'm debugging a PCIe hardware issue on Linux and I want to enable PCIe AER driver on linux to catch any AER errors reported by my hardware device. I'm following this wiki:
https://www.kernel.org/doc/Documentation/PCI/pcieaer-howto.txt
My syslog shows AER is enabled
0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.15.0-108-generic root=UUID=a9f6d189-c13d-485c-a504-ba0aa0127e2e ro quiet splash aerdriver.forceload=y crashkernel=512M-:192M vt.handoff=1
[ 0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.15.0-108-generic root=UUID=a9f6d189-c13d-485c-a504-ba0aa0127e2e ro quiet splash aerdriver.forceload=y crashkernel=512M-:192M vt.handoff=1
[ 0.640130] acpi PNP0A08:00: _OSC: OS now controls [PCIeHotplug PME AER PCIeCapability]
[ 0.661638] acpi PNP0A08:01: _OSC: OS now controls [PCIeHotplug PME AER PCIeCapability]
[ 0.678143] acpi PNP0A08:02: _OSC: OS now controls [PCIeHotplug PME AER PCIeCapability]
[ 0.694863] acpi PNP0A08:03: _OSC: OS now controls [PCIeHotplug PME AER PCIeCapability]
[ 4.747041] acpi PNP0A08:04: _OSC: OS now controls [PCIeHotplug PME AER PCIeCapability]
[ 4.751760] acpi PNP0A08:05: _OSC: OS now controls [PCIeHotplug PME AER PCIeCapability]
[ 4.758480] acpi PNP0A08:06: _OSC: OS now controls [PCIeHotplug PME AER PCIeCapability]
[ 4.763990] acpi PNP0A08:07: _OSC: OS now controls [PCIeHotplug PME AER PCIeCapability]
[ 5.463432] pcieport 0000:00:01.1: AER enabled with IRQ 34
[ 5.463450] pcieport 0000:00:07.1: AER enabled with IRQ 35
[ 5.463472] pcieport 0000:00:08.1: AER enabled with IRQ 37
[ 5.463517] pcieport 0000:10:01.1: AER enabled with IRQ 38
[ 5.463547] pcieport 0000:10:07.1: AER enabled with IRQ 39
[ 5.463575] pcieport 0000:10:08.1: AER enabled with IRQ 41
[ 5.463604] pcieport 0000:20:03.1: AER enabled with IRQ 42
[ 5.463635] pcieport 0000:20:07.1: AER enabled with IRQ 44
[ 5.463663] pcieport 0000:20:08.1: AER enabled with IRQ 46
[ 5.463782] pcieport 0000:30:03.1: AER enabled with IRQ 47
[ 5.463811] pcieport 0000:30:07.1: AER enabled with IRQ 49
[ 5.463843] pcieport 0000:30:08.1: AER enabled with IRQ 51
[ 5.463872] pcieport 0000:40:07.1: AER enabled with IRQ 62
[ 5.463895] pcieport 0000:40:08.1: AER enabled with IRQ 64
[ 5.463930] pcieport 0000:50:07.1: AER enabled with IRQ 66
[ 5.463965] pcieport 0000:50:08.1: AER enabled with IRQ 68
[ 5.464000] pcieport 0000:60:07.1: AER enabled with IRQ 70
[ 5.464044] pcieport 0000:60:08.1: AER enabled with IRQ 72
[ 5.464071] pcieport 0000:70:07.1: AER enabled with IRQ 74
[ 5.464099] pcieport 0000:70:08.1: AER enabled with IRQ 76
The hardware device is a Samsung SSD connected to the Root Complex by a PCIe switch
PCIe Topology : Root Complex - <PLDA PCIe switch + FPGA> - Samsung EVO SSD
Unfortunately, I'm seeing a lot of NVMe related errors but no AER errors are outputted.
Jun 26 12:13:54 ndra-Diesel kernel: [ 1080.672606] nvme1n1: p1 p2
Jun 26 12:14:27 ndra-Diesel kernel: [ 1113.542592] nvme nvme1: I/O 832 QID 5 timeout, aborting
Jun 26 12:14:27 ndra-Diesel kernel: [ 1113.542617] nvme nvme1: I/O 833 QID 5 timeout, aborting
Jun 26 12:14:27 ndra-Diesel kernel: [ 1113.542627] nvme nvme1: I/O 834 QID 5 timeout, aborting
Jun 26 12:14:27 ndra-Diesel kernel: [ 1113.542636] nvme nvme1: I/O 835 QID 5 timeout, aborting
Jun 26 12:14:27 ndra-Diesel kernel: [ 1113.542645] nvme nvme1: I/O 872 QID 5 timeout, aborting
Jun 26 12:14:27 ndra-Diesel kernel: [ 1113.542654] nvme nvme1: I/O 873 QID 5 timeout, aborting
Jun 26 12:14:27 ndra-Diesel kernel: [ 1113.542662] nvme nvme1: I/O 874 QID 5 timeout, aborting
Jun 26 12:14:27 ndra-Diesel kernel: [ 1113.542670] nvme nvme1: I/O 875 QID 5 timeout, aborting
Jun 26 12:14:58 ndra-Diesel kernel: [ 1144.262425] nvme nvme1: I/O 832 QID 5 timeout, reset controller
Jun 26 12:15:29 ndra-Diesel kernel: [ 1174.982243] nvme nvme1: I/O 16 QID 0 timeout, reset controller
Jun 26 12:15:40 ndra-Diesel gnome-software[6474]: no app for changed ubuntu-dock#ubuntu.com
I have custom compiled my kernel with following options:
cat /boot/config-4.15.0-108-generic | grep -i PCIE
CONFIG_ACPI_APEI_PCIEAER=y
CONFIG_PCIEAER=y
CONFIG_PCIEAER_INJECT=y
CONFIG_PCIEPORTBUS=y
The lspci output for my Samsung NVMe shows that it has AER Capability:
37:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller SM981/PM981 (prog-if 02 [NVM Express])
Subsystem: Samsung Electronics Co Ltd Device a801
Flags: bus master, fast devsel, latency 0, IRQ 54, NUMA node 3
Memory at b6500000 (64-bit, non-prefetchable) [size=16K]
Capabilities: [40] Power Management version 3
Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
Capabilities: [70] Express Endpoint, MSI 00
Capabilities: [b0] MSI-X: Enable+ Count=33 Masked-
Capabilities: [100] Advanced Error Reporting <----------------------------- SEE THIS
Capabilities: [148] Device Serial Number 00-00-00-00-00-00-00-00
Capabilities: [158] Power Budgeting <?>
Capabilities: [168] #19
Capabilities: [188] Latency Tolerance Reporting
Capabilities: [190] L1 PM Substates
Kernel driver in use: nvme
Kernel modules: nvme
But the lscpi for PLDA switch doesn't show it has AER Capability
3:00.0 PCI bridge: PLDA XpressSwitch (prog-if 00 [Normal decode])
Flags: bus master, fast devsel, latency 0, IRQ 53, NUMA node 3
Bus: primary=33, secondary=34, subordinate=3b, sec-latency=0
Memory behind bridge: b6400000-b65fffff
Capabilities: [80] Express Upstream Port, MSI 00
Capabilities: [e0] MSI: Enable- Count=1/1 Maskable- 64bit+
Capabilities: [f8] Power Management version 3
Capabilities: [100] Vendor Specific Information: ID=1556 Rev=1 Len=008 <?>
Capabilities: [300] #19
Kernel driver in use: pcieport
Kernel modules: shpchp
I have two Questions :
The Samsung NVMe is behind the PLDA switch in the topology and the switch doesn't have AER capability. Can this be the reason I'm not seeing AER errors from the NVMe ?
Do I need to do anything else to enable AER on linux ?
Try adding this to the end of your config file:
pcie_ports=native

WPA-Supplicant Not Working on Raspbian on Raspberry Pi 3B+

The new Raspberry pi 3b+ appears to have issues with using wpa_supplicant out of the box. If I configure and try to connect a network, I will receive an error that another program has created that interface.
It appears that networking is creating this interface and when wpa-supplicant tries to get ahold of it it cannot, and it appears that this issue is exclusive to the Pi 3B+. I have done the exact same thing on a raspberry pi 3B and successfully associated to the network. If you manually delete this 'wlan0' file you can connect to an SSID:
ctrl_iface bind(PF_UNIX) failed: Address already in use
ctrl_iface exists and seems to be in use - cannot override it
Delete '/var/run/wpa_supplicant/wlan0' manually if it is not used anymore
Here's the shell output:
root#raspberrypi:~# nano /etc/wpa_supplicant/wpa_supplicant.conf
root#raspberrypi:~# sudo wpa_supplicant -d -c /etc/wpa_supplicant/wpa_supplicant.conf -iwlan0
wpa_supplicant v2.4
random: Trying to read entropy from /dev/random
Successfully initialized wpa_supplicant
Initializing interface 'wlan0' conf '/etc/wpa_supplicant/wpa_supplicant.conf' driver 'default' ctrl_interface 'N/A' bridge 'N/A'
Configuration file '/etc/wpa_supplicant/wpa_supplicant.conf' -> '/etc/wpa_supplicant/wpa_supplicant.conf'
Reading configuration file '/etc/wpa_supplicant/wpa_supplicant.conf'
ctrl_interface='DIR=/var/run/wpa_supplicant GROUP=netdev'
update_config=1
country='CA'
Priority group 0
id=0 ssid='CH_TEST_PSK'
rfkill: initial event: idx=0 type=1 op=0 soft=0 hard=0
rfkill: initial event: idx=1 type=2 op=0 soft=0 hard=0
nl80211: TDLS supported
nl80211: Supported cipher 00-0f-ac:1
nl80211: Supported cipher 00-0f-ac:5
nl80211: Supported cipher 00-0f-ac:2
nl80211: Supported cipher 00-0f-ac:4
nl80211: Supported cipher 00-0f-ac:6
nl80211: Using driver-based off-channel TX
nl80211: Supported vendor command: vendor_id=0x1018 subcmd=1
nl80211: Use separate P2P group interface (driver advertised support)
nl80211: Enable multi-channel concurrent (driver advertised support)
nl80211: use P2P_DEVICE support
nl80211: interface wlan0 in phy phy0
nl80211: Set mode ifindex 3 iftype 2 (STATION)
nl80211: Subscribe to mgmt frames with non-AP handle 0x205e8a0
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=040a
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 04 0a
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=040b
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 04 0b
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=040c
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 04 0c
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=040d
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 04 0d
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=090a
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 09 0a
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=090b
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 09 0b
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=090c
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 09 0c
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=090d
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 09 0d
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=0409506f9a09
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=6): 04 09 50 6f 9a 09
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=7f506f9a09
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=5): 7f 50 6f 9a 09
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=0801
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 08 01
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=040e
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 04 0e
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=06
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=1): 06
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=0a07
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 0a 07
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=0a11
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 0a 11
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=1101
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 11 01
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=1102
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 11 02
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=0505
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 05 05
nl80211: Failed to register Action frame processing - ignore for now
netlink: Operstate: ifindex=3 linkmode=1 (userspace-control), operstate=5 (IF_OPER_DORMANT)
nl80211: driver param='(null)'
Add interface wlan0 to a new radio phy0
nl80211: Regulatory information - country=CA (DFS-FCC)
nl80211: 2402-2472 # 40 MHz 30 mBm
nl80211: 5170-5250 # 80 MHz 17 mBm
nl80211: 5250-5330 # 80 MHz 24 mBm (DFS)
nl80211: 5490-5600 # 80 MHz 24 mBm (DFS)
nl80211: 5650-5730 # 80 MHz 24 mBm (DFS)
nl80211: 5735-5835 # 80 MHz 30 mBm
nl80211: Added 802.11b mode based on 802.11g information
wlan0: Own MAC address: b8:27:eb:8d:6c:a6
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=0 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=1 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=2 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=3 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=4 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=5 set_tx=0 seq_len=0 key_len=0
wlan0: RSN: flushing PMKID list in the driver
nl80211: Flush PMKIDs
TDLS: TDLS operation supported by driver
TDLS: Driver uses internal link setup
TDLS: Driver does not support TDLS channel switching
wlan0: WPS: UUID based on MAC address: f6acd183-6b29-5478-a029-fbe96b5112e6
ENGINE: Loading dynamic engine
ENGINE: Loading dynamic engine
EAPOL: SUPP_PAE entering state DISCONNECTED
EAPOL: Supplicant port status: Unauthorized
nl80211: Skip set_supp_port(unauthorized) while not associated
EAPOL: KEY_RX entering state NO_KEY_RECEIVE
EAPOL: SUPP_BE entering state INITIALIZE
EAP: EAP entering state DISABLED
Using existing control interface directory.
ctrl_interface_group=108 (from group name 'netdev')
ctrl_iface bind(PF_UNIX) failed: Address already in use
ctrl_iface exists and seems to be in use - cannot override it
Delete '/var/run/wpa_supplicant/wlan0' manually if it is not used anymore
Failed to initialize control interface 'DIR=/var/run/wpa_supplicant GROUP=netdev'.
You may have another wpa_supplicant process already running or the file was
left by an unclean termination of wpa_supplicant in which case you will need
to manually remove this file before starting wpa_supplicant again.
Failed to add interface wlan0
wlan0: Request to deauthenticate - bssid=00:00:00:00:00:00 pending_bssid=00:00:00:00:00:00 reason=3 state=DISCONNECTED
TDLS: Tear down peers
wlan0: State: DISCONNECTED -> DISCONNECTED
nl80211: Set wlan0 operstate 0->0 (DORMANT)
netlink: Operstate: ifindex=3 linkmode=-1 (no change), operstate=5 (IF_OPER_DORMANT)
EAPOL: External notification - portEnabled=0
EAPOL: External notification - portValid=0
wlan0: WPA: Clear old PMK and PTK
wlan0: Cancelling delayed sched scan
wlan0: Cancelling scan request
wlan0: Cancelling authentication timeout
Remove interface wlan0 from radio phy0
Remove radio phy0
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
nl80211: Remove monitor interface: refcount=0
netlink: Operstate: ifindex=3 linkmode=0 (kernel-control), operstate=6 (IF_OPER_UP)
nl80211: Set mode ifindex 3 iftype 2 (STATION)
nl80211: Unsubscribe mgmt frames handle 0x8a8d6029 (mode change)

WPA supplicant ERROR WPA: 4-Way Handshake failed in WiFi Direct setup

I am trying to set up WiFi Direct between two linux machines. I am using Atheros 9k cards to set up the connections. We have a problem in the process which I hope you guys can help me.
When I run WPA Supplicant in both of the parts, I get this:
wpa_supplicant -B -D nl80211 -i wlan0 -cp2p.conf -d
wpa_supplicant v2.2-devel
random: Trying to read entropy from /dev/random
Successfully initialized wpa_supplicant
Initializing interface 'wlan0' conf 'p2p.conf' driver 'nl80211' ctrl_interface 'N/A' bridge 'N/A'
Configuration file 'p2p.conf' -> '/root/p2p.conf'
Reading configuration file '/root/p2p.conf'
ctrl_interface='/var/run/wpa_supplicant'
ap_scan=2
update_config=1
device_name='giulia118'
p2p_go_ht40=1
Priority group 0
id=0 ssid='Direct_Network'
nl80211: Could not add multicast membership for vendor events: -2 (No such file or directory)
rfkill: initial event: idx=0 type=1 op=0 soft=0 hard=0
rfkill: initial event: idx=1 type=1 op=0 soft=0 hard=0
nl80211: Supported cipher 00-0f-ac:1
nl80211: Supported cipher 00-0f-ac:5
nl80211: Supported cipher 00-0f-ac:2
nl80211: Supported cipher 00-0f-ac:4
nl80211: Supported cipher 00-0f-ac:6
nl80211: Using driver-based off-channel TX
nl80211: interface wlan0 in phy phy0
nl80211: Set mode ifindex 4 iftype 2 (STATION)
nl80211: Subscribe to mgmt frames with non-AP handle 0x9fa4380
nl80211: Register frame type=0xd0 nl_handle=0x9fa4380 match=040a
nl80211: Register frame type=0xd0 nl_handle=0x9fa4380 match=040b
nl80211: Register frame type=0xd0 nl_handle=0x9fa4380 match=040c
nl80211: Register frame type=0xd0 nl_handle=0x9fa4380 match=040d
nl80211: Register frame type=0xd0 nl_handle=0x9fa4380 match=090a
nl80211: Register frame type=0xd0 nl_handle=0x9fa4380 match=090b
nl80211: Register frame type=0xd0 nl_handle=0x9fa4380 match=090c
nl80211: Register frame type=0xd0 nl_handle=0x9fa4380 match=090d
nl80211: Register frame type=0xd0 nl_handle=0x9fa4380 match=0409506f9a09
nl80211: Register frame type=0xd0 nl_handle=0x9fa4380 match=7f506f9a09
nl80211: Register frame type=0xd0 nl_handle=0x9fa4380 match=06
nl80211: Register frame type=0xd0 nl_handle=0x9fa4380 match=0a07
nl80211: Register frame type=0xd0 nl_handle=0x9fa4380 match=0a11
netlink: Operstate: ifindex=4 linkmode=1 (userspace-control), operstate=5 (IF_OPER_DORMANT)
nl80211: driver param='(null)'
Add interface wlan0 to a new radio phy0
nl80211: Regulatory information - country=00
nl80211: 2402-2472 # 40 MHz 20 mBm
nl80211: 2457-2482 # 20 MHz 20 mBm (no IR)
nl80211: 2474-2494 # 20 MHz 20 mBm (no OFDM) (no IR)
nl80211: 5170-5250 # 40 MHz 20 mBm (no IR)
nl80211: 5735-5835 # 40 MHz 20 mBm (no IR)
nl80211: Added 802.11b mode based on 802.11g information
wlan0: Own MAC address: 04:f0:21:06:1d:14
wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=0 addr=(nil) key_idx=0 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=0 addr=(nil) key_idx=1 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=0 addr=(nil) key_idx=2 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=0 addr=(nil) key_idx=3 set_tx=0 seq_len=0 key_len=0
wlan0: RSN: flushing PMKID list in the driver
nl80211: Flush PMKIDs
wlan0: Setting scan request: 0.100000 sec
wlan0: WPS: UUID based on MAC address: 94f8bf7f-bad8-5fc8-87c2-05c3afbed265
EAPOL: SUPP_PAE entering state DISCONNECTED
EAPOL: Supplicant port status: Unauthorized
nl80211: Skip set_supp_port(unauthorized) while not associated
EAPOL: KEY_RX entering state NO_KEY_RECEIVE
EAPOL: SUPP_BE entering state INITIALIZE
EAP: EAP entering state DISABLED
P2P: Own listen channel: 6
P2P: Random operating channel: 81:6
P2P: Add operating class 81
P2P: Channels - hexdump(len=11): 01 02 03 04 05 06 07 08 09 0a 0b
P2P: Add operating class 115
P2P: Channels - hexdump(len=4): 24 28 2c 30
P2P: Add operating class 124
P2P: Channels - hexdump(len=4): 95 99 9d a1
P2P: Add operating class 116
P2P: Channels - hexdump(len=2): 24 2c
P2P: Add operating class 117
P2P: Channels - hexdump(len=2): 28 30
P2P: Add operating class 126
P2P: Channels - hexdump(len=2): 95 9d
P2P: Add operating class 127
P2P: Channels - hexdump(len=2): 99 a1
P2P: initialized
P2P: channels: 81:1,2,3,4,5,6,7,8,9,10,11 115:36,40,44,48 124:149,153,157,161 116:36,44 117:40,48 126:149,157 127:153,161
P2P: cli_channels:
wlan0: Added interface wlan0
wlan0: State: DISCONNECTED -> DISCONNECTED
nl80211: Set wlan0 operstate 0->0 (DORMANT)
netlink: Operstate: ifindex=4 linkmode=-1 (no change), operstate=5 (IF_OPER_DORMANT)
Daemonize..
Then I run wpa_cli and I use the commands for create a p2p group in pbc (Pusg button Control), and the final messages of the failed connection are:
1st Device:
<3>WPS-AP-AVAILABLE-PBC
<3>SME: Trying to authenticate with 04:f0:21:06:1d:1f (SSID='DIRECT-Mj' freq=2412 MHz)
<3>Trying to associate with 04:f0:21:06:1d:1f (SSID='DIRECT-Mj' freq=2412 MHz)
<3>Associated with 04:f0:21:06:1d:1f
<3>CTRL-EVENT-EAP-STARTED EAP authentication started
<3>CTRL-EVENT-EAP-STATUS status='started' parameter=''
<3>CTRL-EVENT-EAP-PROPOSED-METHOD vendor=14122 method=1
<3>CTRL-EVENT-EAP-STATUS status='accept proposed method' parameter='WSC'
<3>CTRL-EVENT-EAP-METHOD EAP vendor 14122 method 1 (WSC) selected
<3>WPS-CRED-RECEIVED
<3>WPS-SUCCESS
<3>P2P-GROUP-FORMATION-SUCCESS
<3>CTRL-EVENT-EAP-STATUS status='completion' parameter='failure'
<3>CTRL-EVENT-EAP-FAILURE EAP authentication failed
<3>CTRL-EVENT-DISCONNECTED bssid=04:f0:21:06:1d:1f reason=3 locally_generated=1
<3>SME: Trying to authenticate with 04:f0:21:06:1d:1f (SSID='DIRECT-Mj' freq=2412 MHz)
<3>Trying to associate with 04:f0:21:06:1d:1f (SSID='DIRECT-Mj' freq=2412 MHz)
<3>CTRL-EVENT-REGDOM-CHANGE init=DRIVER type=WORLD
<3>Associated with 04:f0:21:06:1d:1f
<3>CTRL-EVENT-DISCONNECTED bssid=04:f0:21:06:1d:1f reason=2
<3>WPA: 4-Way Handshake failed - pre-shared key may be incorrect
<3>CTRL-EVENT-REGDOM-CHANGE init=DRIVER type=WORLD
<3>CTRL-EVENT-SCAN-STARTED
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>P2P-GROUP-FORMATION-FAILURE
<3>P2P-GROUP-REMOVED wlan0 client reason=FORMATION_FAILED
2nd Device:
<3>AP-ENABLED
<3>CTRL-EVENT-CONNECTED - Connection to 04:f0:21:06:1d:1f completed [id=1 id_str=]
<3>P2P-GROUP-STARTED wlan0 GO ssid="DIRECT-Mj" freq=2412 passphrase="ZPHbkRAf" go_dev_addr=04:f0:21:06:1d:1f
wps_pbc
> OK
<3>WPS-PBC-ACTIVE
<3>P2P-PROV-DISC-PBC-REQ 04:f0:21:06:1d:14 p2p_dev_addr=04:f0:21:06:1d:14 pri_dev_type=1-0050F204-1 name='giulia118' config_methods=0x108 dev_capab=0x21 group_capab=0x0 group=wlan0
<3>WPS-ENROLLEE-SEEN 04:f0:21:06:1d:14 94f8bf7f-bad8-5fc8-87c2-05c3afbed265 1-0050F204-1 0x2108 4 1 [giulia118]
<3>CTRL-EVENT-EAP-STARTED 04:f0:21:06:1d:14
<3>CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=1
<3>CTRL-EVENT-EAP-PROPOSED-METHOD vendor=14122 method=254
<3>WPS-REG-SUCCESS 04:f0:21:06:1d:14 94f8bf7f-bad8-5fc8-87c2-05c3afbed265
<3>WPS-PBC-DISABLE
<3>WPS-SUCCESS
<3>CTRL-EVENT-EAP-FAILURE 04:f0:21:06:1d:14
<3>WPS-ENROLLEE-SEEN 04:f0:21:06:1d:14 94f8bf7f-bad8-5fc8-87c2-05c3afbed265 1-0050F204-1 0x2108 0 0 [giulia118]
The content of my configuration (p2p.conf) file is:
1st Device:
ctrl_interface=/var/run/wpa_supplicant
ap_scan=2
fast_reauth=1
update_config=1
device_name=giulia116
device_type=1-0050F204-1
p2p_go_ht40=1
network={
ssid="Direct_Network"
psk="12345678"
proto=RSN WPA
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP
}
2nd Device:
ctrl_interface=/var/run/wpa_supplicant
ap_scan=2
update_config=1
device_name=giulia118
device_type=1-0050F204-1
p2p_go_ht40=1
network={
ssid="Direct_Network"
psk="12345678"
key_mgmt=WPA-PSK
group=CCMP TKIP
}
ifconfig:
eth0 Link encap:Ethernet HWaddr 00:0d:b9:2e:1b:88
inet addr:192.168.97.116 Bcast:192.168.97.255 Mask:255.255.255.0
inet6 addr: fe80::20d:b9ff:fe2e:1b88/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2949 errors:0 dropped:0 overruns:0 frame:0
TX packets:1840 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:321032 (321.0 KB) TX bytes:268766 (268.7 KB)
Interrupt:10 Base address:0xe000
eth1 Link encap:Ethernet HWaddr 00:0d:b9:2e:1b:89
inet addr:172.16.0.235 Bcast:172.16.0.255 Mask:255.255.255.0
inet6 addr: fe80::20d:b9ff:fe2e:1b89/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:163951 errors:0 dropped:0 overruns:0 frame:0
TX packets:35 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:17016272 (17.0 MB) TX bytes:4093 (4.0 KB)
Interrupt:15
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
mon.wlan0 Link encap:UNSPEC HWaddr 04-F0-21-06-1D-1F-30-30-00-00-00-00-00-00-00-00
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:716 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:104534 (104.5 KB) TX bytes:0 (0.0 B)
wlan0 Link encap:Ethernet HWaddr 04:f0:21:06:1d:1f
inet6 addr: fe80::6f0:21ff:fe06:1d1f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:13 errors:0 dropped:0 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2154 (2.1 KB) TX bytes:576 (576.0 B)
.config :
CONFIG_DRIVER_NL80211=y
CONFIG_READLINE=y
CONFIG_CTRL_IFACE=y
CONFIG_WPS=y
CONFIG_WPS2=y
CONFIG_P2P=y
CONFIG_AP=y
#CONFIG_DRIVER_WEXT=y
#CONFIG_DRIVER_BSD=y
#CONFIG_DRIVER_NDIS=y
CONFIG_IEEE8021X_EAPOL=y
#CONFIG_EAP_MD5=y
#CONFIG_EAP_MSCHAPV2=y
CONFIG_EAP_TLS=y
CONFIG_EAP_PEAP=y
#CONFIG_EAP_TTLS=y
#CONFIG_EAP_GTC=y
#CONFIG_EAP_OTP=y
#CONFIG_EAP_SIM=y
#CONFIG_EAP_AKA=y
CONFIG_EAP_PSK=y
#CONFIG_EAP_SAKE=y
#CONFIG_EAP_GPSK=y
#CONFIG_EAP_PAX=y
CONFIG_EAP_LEAP=y
#CONFIG_EAP_IKEV2=y
#CONFIG_PCSC=y
The error seems to be related to the “4-Way Handshake” failure. Could it be that the pre-shared key is incorrect? Why I have a “GROUP REMOVED” ?
I would appreciate any suggestion regarding the matter.
Thank you all in advance!

Is there a C/C++ API to the route information on Windows?

Is there a windows or cygwin C/C++ API to collect information provided by the route command on Windows? I'm specifically interested in the route metrics. Here's an example of what route outputs, the IPs have been changed to protect the innocent.
$ route PRINT -4
===========================================================================
Interface List
11...64 31 50 3b ba 96 ......Broadcom NetXtreme Gigabit Ethernet
17...00 50 56 c0 00 01 ......VMware Virtual Ethernet Adapter for VMnet1
18...00 50 56 c0 00 08 ......VMware Virtual Ethernet Adapter for VMnet8
1...........................Software Loopback Interface 1
12...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter
10...00 00 00 00 00 00 00 e0 Microsoft Teredo Tunneling Adapter
13...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #2
14...00 00 00 00 00 00 00 e0 Microsoft 6to4 Adapter
15...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #3
===========================================================================
IPv4 Route Table
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 99.10.168.1 99.10.170.11 10
99.10.168.0 255.255.248.0 On-link 99.10.170.11 266
99.10.170.11 255.255.255.255 On-link 99.10.170.11 266
99.10.175.255 255.255.255.255 On-link 99.10.170.11 266
127.0.0.0 255.0.0.0 On-link 127.0.0.1 306
127.0.0.1 255.255.255.255 On-link 127.0.0.1 306
127.255.255.255 255.255.255.255 On-link 127.0.0.1 306
You should use GetIpForwardTable as the Routing Table Manager API only works for Server editions of Windows.
You want the Routing Table Manager API.

Resources