$OpenBSD: patch-src_libnet_link_bpf_c,v 1.1 2008/11/08 22:17:41 sthen Exp $
--- src/libnet_link_bpf.c.orig	Sat Nov  8 21:55:03 2008
+++ src/libnet_link_bpf.c	Sat Nov  8 21:56:56 2008
@@ -43,6 +43,7 @@
 #include <sys/sysctl.h>
 #include <net/route.h>
 #include <net/if_dl.h>
+#include <net/if_types.h>
 #include "../include/gnuc.h"
 #include "../include/bpf.h"
 
@@ -308,9 +309,13 @@ libnet_get_hwaddr(libnet_t *l)
     for (next = buf ; next < end ; next += ifm->ifm_msglen)
     {
         ifm = (struct if_msghdr *)next;
+        if (ifm->ifm_version != RTM_VERSION)
+            continue;
         if (ifm->ifm_type == RTM_IFINFO)
         {
             sdl = (struct sockaddr_dl *)(ifm + 1);
+            if (sdl->sdl_type != IFT_ETHER)
+                continue;
             if (strncmp(&sdl->sdl_data[0], l->device, sdl->sdl_nlen) == 0)
             {
                 if (!(ea = malloc(sizeof(struct libnet_ether_addr))))
