diff -Naur olsrd-a5b9cf969979/Makefile.inc olsrd-a5b9cf969979.netbsd/Makefile.inc
--- olsrd-a5b9cf969979/Makefile.inc	2008-02-06 19:32:49.000000000 +0100
+++ olsrd-a5b9cf969979.netbsd/Makefile.inc	2008-02-08 19:50:38.000000000 +0100
@@ -40,12 +40,13 @@
 TAGCMD ?=	etags
 
 # target directories and names
+PREFIX	?= /usr/local
 DESTDIR ?=
-SBINDIR ?= $(DESTDIR)/usr/sbin
-ETCDIR  ?= $(DESTDIR)/etc
-LIBDIR  ?= $(DESTDIR)/usr/lib
-DOCDIR  ?= $(DESTDIR)/usr/share/doc
-MANDIR  ?= $(DESTDIR)/usr/share/man
+SBINDIR ?= $(DESTDIR)/$(PREFIX)/sbin
+ETCDIR  ?= $(DESTDIR)/$(PREFIX)/etc
+LIBDIR  ?= $(DESTDIR)/$(PREFIX)/lib
+DOCDIR  ?= $(DESTDIR)/$(PREFIX)/share/doc
+MANDIR  ?= $(DESTDIR)/$(PREFIX)/share/man
 EXENAME ?= olsrd
 CFGNAME ?= $(EXENAME).conf
 CFGFILE ?= $(ETCDIR)/$(CFGNAME)
diff -Naur olsrd-a5b9cf969979/make/Makefile.nbsd olsrd-a5b9cf969979.netbsd/make/Makefile.nbsd
--- olsrd-a5b9cf969979/make/Makefile.nbsd	2008-02-06 19:32:49.000000000 +0100
+++ olsrd-a5b9cf969979.netbsd/make/Makefile.nbsd	2008-02-10 02:51:20.000000000 +0100
@@ -8,8 +8,8 @@
 SRCS +=		$(wildcard src/bsd/*.c src/unix/*.c)
 HDRS +=		$(wildcard src/bsd/*.h src/unix/*.h)
 
-CPPFLAGS +=	-D__NetBSD__
-LIBS +=		
+CPPFLAGS +=	-D SPOOF -I /usr/pkg/include/libnet11
+LIBS +=		/usr/pkg/lib/libnet11/libnet.a
 
 PLUGIN_FULLNAME ?= $(PLUGIN_NAME).so.$(PLUGIN_VER)
 INSTALL_LIB =	install -m 755 $(PLUGIN_FULLNAME) $(LIBDIR)/$(PLUGIN_FULLNAME); \
diff -Naur olsrd-a5b9cf969979/src/bsd/net.c olsrd-a5b9cf969979.netbsd/src/bsd/net.c
--- olsrd-a5b9cf969979/src/bsd/net.c	2008-02-06 19:32:49.000000000 +0100
+++ olsrd-a5b9cf969979.netbsd/src/bsd/net.c	2008-04-02 23:41:50.000000000 +0200
@@ -59,6 +59,9 @@
 
 #ifdef __NetBSD__
 #include <net/if_ether.h>
+#include <netinet6/in6_var.h> /* For struct in6_ifreq */
+#include <net80211/ieee80211_ioctl.h>
+#include <ifaddrs.h>
 #endif
 
 #ifdef __OpenBSD__
@@ -110,11 +113,7 @@
 static int set_sysctl_int(const char *name, int new)
 {
   int old;
-#if __MacOSX__ || __OpenBSD__
   size_t len = sizeof (old);
-#else
-  unsigned int len = sizeof (old);
-#endif
 
 #ifdef __OpenBSD__
   int mib[4];
@@ -182,7 +181,7 @@
 
   // do not accept ICMP redirects
 
-#ifdef __OpenBSD__
+#if defined __OpenBSD__ || defined __NetBSD__
   if (version == AF_INET)
     name = "net.inet.icmp.rediraccept";
   else
@@ -786,10 +785,12 @@
 	       ifc->int_name,
 	       iname);
 
+#if 0 /* This is causing trouble */
   if (strcmp (ifc->int_name, iname) != 0)
     {
       return (0);
     }
+#endif
 
   return (count);
 }
@@ -827,6 +828,18 @@
   ireq.i_type = IEEE80211_IOC_SSID;
   ireq.i_val = -1;
   return (ioctl(olsr_cnf->ioctl_s, SIOCG80211, &ireq) >= 0) ? 1 : 0;
+#elif defined __NetBSD__
+  struct ifreq ireq;
+  struct ieee80211_nwid data;
+  int ret;
+
+  memset(&ireq, 0, sizeof(ireq));
+  strlcpy(ireq.ifr_name, ifname, sizeof(ireq.ifr_name));
+  ireq.ifr_data = &data;
+  ret = ioctl(olsr_cnf->ioctl_s, SIOCG80211NWID, &ireq);
+  if(ret == 0)
+	  return 1;
+  return 0;
 #elif defined __OpenBSD__
   struct ieee80211_nodereq nr;
   bzero(&nr, sizeof(nr));
diff -Naur olsrd-a5b9cf969979/src/cfgparser/olsrd_conf.c olsrd-a5b9cf969979.netbsd/src/cfgparser/olsrd_conf.c
--- olsrd-a5b9cf969979/src/cfgparser/olsrd_conf.c	2008-02-06 19:32:49.000000000 +0100
+++ olsrd-a5b9cf969979.netbsd/src/cfgparser/olsrd_conf.c	2008-02-08 19:45:57.000000000 +0100
@@ -625,7 +625,7 @@
             printf("\tLinkQualityMult          : %s %0.2f\n", inet_ntop(cnf->ip_version, &mult->addr, ipv6_buf, sizeof (ipv6_buf)), mult->val);
           }
 
-          printf("\tAutodetetc changes       : %s\n", in->cnf->autodetect_chg ? "yes" : "no");
+          printf("\tAutodetect changes       : %s\n", in->cnf->autodetect_chg ? "yes" : "no");
 
 	  in = in->next;
 	}
diff -Naur olsrd-a5b9cf969979/src/lq_packet.c olsrd-a5b9cf969979.netbsd/src/lq_packet.c
--- olsrd-a5b9cf969979/src/lq_packet.c	2008-02-06 19:32:49.000000000 +0100
+++ olsrd-a5b9cf969979.netbsd/src/lq_packet.c	2008-02-10 03:27:00.000000000 +0100
@@ -231,7 +231,7 @@
             neigh->neigh_link_quality = lnk->neigh_link_quality;
           }
           else {
-            OLSR_PRINTF(0, "Error: link_qualtiy undefined");
+            OLSR_PRINTF(0, "Error: link_quality undefined");
             neigh->link_quality = 0.0;
             neigh->neigh_link_quality = 0.0;
           }          
