On 2010/03/31 15:39, Sam Roberts wrote:
> I wonder because I have started maintaining and bug fixing it. Fixes
> include buffer over/under runs, and memory corruption errors.
> 
> I believe redhat and debian have been taking my last releases after I
> fixed their open bugs.
> 
> Anyhow, the dev is happening here:
> 
> http://github.com/sam-github/libnet/
> 
> Indications here:
> 
> http://www.freshports.org/net/libnet
> 
> and in other places are that there are packagers have downstream fixes
> that have been ignored.
> 
> I will take them, if you wish.
> 
> Cheers,
> Sam
> 

Thanks - there's no specific OpenBSD libnet maintainer at the moment, 
but I'll try and move the port to your version when I get some time..

Looking over our patches, some are to install to an alternative
location so 1.1 and 1.0 can co-exist; another to build as a shared
library (just by patching Makefile.in so I'm not sure you'll want
that directly), and this patch is needed in order that
libnet_get_hwaddr can work in the last few releases of OpenBSD.

--- 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))))

Reply via email to