aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasashi Honma <honma@ictec.co.jp>2009-08-26 20:40:51 (GMT)
committerJouni Malinen <j@w1.fi>2009-11-22 18:38:18 (GMT)
commitdb3717543f21c3d85a8225814f53c6e8cc85730d (patch)
tree13d6d618a64af66c0cdf94be24c2f7c3480029f8
parentff066ec798bf7a1da5e5688cada8f1ff5de37d90 (diff)
downloadhostap-06-db3717543f21c3d85a8225814f53c6e8cc85730d.zip
hostap-06-db3717543f21c3d85a8225814f53c6e8cc85730d.tar.gz
hostap-06-db3717543f21c3d85a8225814f53c6e8cc85730d.tar.bz2
OpenBSD: wired IEEE 802.1X for OpenBSD
This is a patch for OpenBSD wired IEEE 802.1X. This is only for wired, not wireless, because OpenBSD uses wpa_supplicant only on wired now. http://www.openbsd.org/cgi-bin/cvsweb/ports/security/wpa_supplicant/ I have tested with these. OS : OpenBSD 4.5 EAP : EAP-TLS Switch : CentreCOM 8724SL (cherry picked from commit 80cc6bf6d0f9b86603e5181cdf11d984dded89cc)
-rw-r--r--src/drivers/driver_wired.c4
-rw-r--r--src/utils/common.h11
-rw-r--r--src/utils/os_unix.c3
3 files changed, 13 insertions, 5 deletions
diff --git a/src/drivers/driver_wired.c b/src/drivers/driver_wired.c
index e5e57c5..186f349 100644
--- a/src/drivers/driver_wired.c
+++ b/src/drivers/driver_wired.c
@@ -131,7 +131,7 @@ 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__
+#if defined(__NetBSD__) || defined(__OpenBSD__)
{
struct sockaddr *sap;
sap = (struct sockaddr *) &ifr.ifr_addr;
@@ -139,7 +139,7 @@ static int wpa_driver_wired_multi(const char *ifname, const u8 *addr, int add)
sap->sa_family = AF_UNSPEC;
os_memcpy(sap->sa_data, addr, ETH_ALEN);
}
-#endif /* __NetBSD__ */
+#endif /* defined(__NetBSD__) || defined(__OpenBSD__) */
if (ioctl(s, add ? SIOCADDMULTI : SIOCDELMULTI, (caddr_t) &ifr) < 0) {
perror("ioctl[SIOC{ADD/DEL}MULTI]");
diff --git a/src/utils/common.h b/src/utils/common.h
index 79607d7..d649391 100644
--- a/src/utils/common.h
+++ b/src/utils/common.h
@@ -22,17 +22,24 @@
#include <byteswap.h>
#endif /* __linux__ */
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || \
+ defined(__OpenBSD__)
#include <sys/types.h>
#include <sys/endian.h>
#define __BYTE_ORDER _BYTE_ORDER
#define __LITTLE_ENDIAN _LITTLE_ENDIAN
#define __BIG_ENDIAN _BIG_ENDIAN
+#ifdef __OpenBSD__
+#define bswap_16 swap16
+#define bswap_32 swap32
+#define bswap_64 swap64
+#else /* __OpenBSD__ */
#define bswap_16 bswap16
#define bswap_32 bswap32
#define bswap_64 bswap64
+#endif /* __OpenBSD__ */
#endif /* defined(__FreeBSD__) || defined(__NetBSD__) ||
- * defined(__DragonFly__) */
+ * defined(__DragonFly__) || defined(__OpenBSD__) */
#ifdef __APPLE__
#include <sys/types.h>
diff --git a/src/utils/os_unix.c b/src/utils/os_unix.c
index 060892d..bc2fc40 100644
--- a/src/utils/os_unix.c
+++ b/src/utils/os_unix.c
@@ -227,7 +227,8 @@ int os_setenv(const char *name, const char *value, int overwrite)
int os_unsetenv(const char *name)
{
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) || \
+ defined(__OpenBSD__)
unsetenv(name);
return 0;
#else