Subject: Re: hostapd on NetBSD?
To: Teemu Rinta-aho <teemu@rinta-aho.org>
From: Ronald van der Pol <Ronald.vanderPol@rvdp.org>
List: current-users
Date: 08/01/2005 14:47:07
On Fri, Jul 29, 2005 at 13:19:05 +0300, Teemu Rinta-aho wrote:

> Sure, I know all of that.. I'm already running it on FreeBSD,
> but the question was if anyone has got it compiled on
> NetBSD (as it now has the net80211 code ported from FreeBSD),
> or should I go hack the code myself...

I have started with wpa_supplicant. It only needs two small changes
in wpa_supplicant-0.3.9 (see below) and some tweaks to the Makefile.
It depends on net/libdnet.

wpa_supplicant compiles, but I have not gotten it running fully
yet. It seems to authenticate fine, I can see traffic on the
interface with tcpdump, but I don't get a dhcp address. My
problem might just be a dhcp problem. I'm still investigating.
I can ping6 the IPv6 link local address of the router.

Also, I see some disconnects. I don't know why this happens.

Disconnect event - remove keys
Trying to associate with 00:0e:d7:b5:04:41 (SSID='ietf63-1x' freq=2452 MHz)
Associated with 00:0e:d7:b5:04:41
EAP-MSCHAPV2: Authentication succeeded
EAP-TLV: TLV Result - Success - EAP-TLV/Phase2 Completed
WPA: Key negotiation completed with 00:0e:d7:b5:04:41 [PTK=TKIP GTK=TKIP]

	rvdp

--- wpa_supplicant-0.3.9.orig/crypto.c	2005-07-23 15:30:09.000000000 +0200
+++ wpa_supplicant-0.3.9/crypto.c	2005-08-01 14:06:46.000000000 +0200
@@ -13,6 +13,7 @@
  */
 
 #include <openssl/md4.h>
+#include <des.h>
 #include <openssl/des.h>
 
 #include "common.h"


--- wpa_supplicant-0.3.9.orig/driver_bsd.c	2005-07-23 16:06:14.000000000 +0200
+++ wpa_supplicant-0.3.9/driver_bsd.c	2005-08-01 14:06:46.000000000 +0200
@@ -362,7 +362,7 @@
 }
 
 #include <net/route.h>
-#include <net80211/ieee80211_freebsd.h>
+#include <net80211/ieee80211_netbsd.h>
 
 static void
 wpa_driver_bsd_event_receive(int sock, void *ctx, void *sock_ctx)


--- wpa_supplicant-0.3.9.orig/Makefile	2005-07-23 16:03:03.000000000 +0200
+++ wpa_supplicant-0.3.9/Makefile	2005-08-01 14:06:46.000000000 +0200
@@ -100,8 +100,10 @@
 endif
 
 ifdef CONFIG_DRIVER_BSD
-CFLAGS += -DCONFIG_DRIVER_BSD
+CFLAGS += -DCONFIG_DRIVER_BSD -I/usr/pkg/include
+LDFLAGS += -R/usr/pkg/lib -L/usr/pkg/lib
 OBJS += driver_bsd.o
+LIBS += -ldes
 CONFIG_DNET_PCAP=y
 endif
 
@@ -303,22 +305,22 @@
 OBJS += wpa_supplicant.o wpa.o l2_packet.o drivers.o
 
 wpa_supplicant: .config $(OBJS)
-	$(CC) -o wpa_supplicant $(OBJS) $(LIBS)
+	$(CC) -o wpa_supplicant $(OBJS) $(LIBS) $(LDFLAGS)
 
 eapol_test: .config $(OBJS_t)
-	$(CC) -o eapol_test $(OBJS_t) $(LIBS)
+	$(CC) -o eapol_test $(OBJS_t) $(LIBS) $(LDFLAGS)
 
 preauth_test: .config $(OBJS_t2) 
-	$(CC) -o preauth_test $(OBJS_t2) $(LIBS)
+	$(CC) -o preauth_test $(OBJS_t2) $(LIBS) $(LDFLAGS)
 
 wpa_passphrase: $(OBJS_p)
-	$(CC) -o wpa_passphrase $(OBJS_p) $(LIBS_p)
+	$(CC) -o wpa_passphrase $(OBJS_p) $(LIBS_p) $(LDFLAGS)
 
 wpa_cli: $(OBJS_c)
-	$(CC) -o wpa_cli $(OBJS_c) $(LIBS_c)
+	$(CC) -o wpa_cli $(OBJS_c) $(LIBS_c) $(LDFLAGS)
 
 win_if_list: win_if_list.c
-	$(CC) -o $@ win_if_list.c $(CFLAGS) $(LIBS_w)
+	$(CC) -o $@ win_if_list.c $(CFLAGS) $(LIBS_w) $(LDFLAGS)
 
 # parameters for Microsoft Visual C++ Toolkit 2003 compiler
 CL=cl