diff -Naur olsrd-0.5.6-r5.orig/src/bsd/net.c olsrd-0.5.6-r5/src/bsd/net.c
--- olsrd-0.5.6-r5.orig/src/bsd/net.c	2009-06-24 19:00:51.000000000 +0200
+++ olsrd-0.5.6-r5/src/bsd/net.c	2009-06-29 15:50:00.000000000 +0200
@@ -73,6 +73,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__
@@ -127,7 +130,7 @@
 set_sysctl_int(const char *name, int new)
 {
   int old;
-#if __MacOSX__ || __OpenBSD__
+#if defined(__MacOSX__) || defined(__OpenBSD__) || defined(__NetBSD__)
   size_t len = sizeof(old);
 #else
   unsigned int len = sizeof(old);
@@ -191,7 +194,7 @@
 
   /* do not accept ICMP redirects */
 
-#ifdef __OpenBSD__
+#if defined(__OpenBSD__) || defined(__NetBSD__)
   if (version == AF_INET)
     name = "net.inet.icmp.rediraccept";
   else
@@ -731,9 +734,11 @@
               inet_ntop(olsr_cnf->ip_version, olsr_cnf->ip_version == AF_INET6 ? (char *)&sin6->sin6_addr : (char *)&sin->sin_addr,
                         addrstr, sizeof(addrstr)), ifc->int_name, iname);
 
+#ifndef __NetBSD__
   if (strcmp(ifc->int_name, iname) != 0) {
     return (0);
   }
+#endif
 
   return (count);
 }
@@ -768,6 +773,18 @@
   bzero(&nr, sizeof(nr));
   strlcpy(nr.nr_ifname, ifname, sizeof(nr.nr_ifname));
   return (ioctl(olsr_cnf->ioctl_s, SIOCG80211FLAGS, &nr) >= 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;
 #else
   ifname = NULL;                /* squelsh compiler warning */
   return 0;
