[PATCH] bsd: Fix wired 802.1x problem

Masashi Honma honma
Mon Aug 10 22:18:55 PDT 2009


Hello.

On NetBSD 5.0, when I use wired 802.1x, "Invalid argument" occurs
on SIOCADDMULTI ioctl. And 802.1x failed.

I tried FreeBSD code, but "Address family not supported by protocol family"
occurs on SIOCADDMULTI ioctl too. And 802.1x failed too.

This patch will solves this issue.

diff --git a/src/drivers/driver_wired.c b/src/drivers/driver_wired.c
index a3657e5..2981264 100644
--- a/src/drivers/driver_wired.c
+++ b/src/drivers/driver_wired.c
@@ -474,6 +474,15 @@ static int wpa_driver_wired_multi(const char *ifname, const u8 *addr, int add)
 		os_memcpy(LLADDR(dlp), addr, ETH_ALEN);
 	}
 #endif /* __FreeBSD__ */
+#ifdef __NetBSD__
+	{
+		struct sockaddr *sap;
+		sap = (struct sockaddr *) &ifr.ifr_addr;
+		sap->sa_len = sizeof(struct sockaddr);
+		sap->sa_family = AF_UNSPEC;
+		os_memcpy(sap->sa_data, addr, ETH_ALEN);
+	}
+#endif /* __NetBSD__ */
 
 	if (ioctl(s, add ? SIOCADDMULTI : SIOCDELMULTI, (caddr_t) &ifr) < 0) {
 		perror("ioctl[SIOC{ADD/DEL}MULTI]");


I have tested with these.
OS : NetBSD 5.0
EAP : EAP-MD5
Switch : CentreCOM 8724SL

Regards,
Masashi Honma.



More information about the Hostap mailing list