- 论坛徽章:
- 0
|
wpa_supplicant移植后(环境为:s3c2416、kernel 2.6.36、busybox1.18.4、wifi为marvell sdio 88w8686)运行
wpa_supplicant -d -iwlan2 -c/etc/p2p.conf
报错:
…………
EAP: EAP entering state DISABLED
EAPOL: Supplicant port status: Unauthorized
EAPOL: Supplicant port status: Unauthorized
socket(PF_UNIX): Address family not supported by protocol
Failed to initialize control interface '/var/run/wpa_supplicant'.
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 wlan2
wlan2: No keys have been configured - skip key clearing
wlan2: State: DISCONNECTED -> DISCONNECTED
…………
跟踪socket(PF_UNIX): Address family not supported by protocol发现到了函数wpa_supplicant_global_ctrl_iface_init就报错了,- priv->sock = socket(PF_UNIX, SOCK_DGRAM, 0);
- if (priv->sock < 0) {
- perror("socket(PF_UNIX)");
- goto fail;
- }
复制代码 是socket函数error:Address family not supported by protocol
流程为:main()函数-->解析命令行参数(main.c)-->wpa_supplicant_init()(wpa_supplicant.c)-->wpa_supplicant_global_ctrl_iface_init()(ctrl_iface_unix.c)-->socket()
将priv->sock = socket(PF_UNIX, SOCK_DGRAM, 0);改为priv->sock = socket(PF_INET, SOCK_DGRAM, 0);
如:- /* priv->sock = socket(PF_UNIX, SOCK_DGRAM, 0);*/
- priv->sock = socket(PF_INET, SOCK_DGRAM, 0);
- if (priv->sock < 0) {
- perror("socket(PF_INET)");
- wpa_printf(MSG_DEBUG,"--------priv->sock = %d ---------\n",priv->sock);
- goto fail;
- }
- os_memset(&addr, 0, sizeof(addr));
- #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
- addr.sun_len = sizeof(addr);
- #endif /* __FreeBSD__ */
- /* addr.sun_family = AF_UNIX;*/
- addr.sun_family = PF_INET;
- fname = wpa_supplicant_ctrl_iface_path(wpa_s);
- if (fname == NULL)
- goto fail;
- os_strlcpy(addr.sun_path, fname, sizeof(addr.sun_path));
- if ( bind(priv->sock, (struct sockaddr *) &addr, sizeof(struct sockaddr_un)) == -1 ) {
- wpa_printf(MSG_DEBUG, "errno = %d and ctrl_iface bind(PF_UNIX) failed: %s",
- errno,strerror(errno));
复制代码 改了后,socket函数OK,但下面bind又出错了:
EAPOL: Supplicant port status: Unauthorized
EAPOL: Supplicant port status: Unauthorized
Using existing control interface directory.
errno = 99 and ctrl_iface bind(PF_UNIX) failed: Cannot assign requested address
ctrl_iface exists and seems to be in use - cannot override it
Delete '/var/run/wpa_supplicant/wlan2' manually if it is not used anymore
Failed to initialize control interface '/var/run/wpa_supplicant'.
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 wlan2
目前不知道咋办了?哪位大虾有搞过这个的,指点下啊,感谢! |
|