From: Roy Marples Date: Fri, 17 Apr 2009 13:42:44 +0000 (+0000) Subject: Fix compile on FreeBSD. X-Git-Tag: v5.0.0~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47681a7058d5f9a4235aa42fd509d2c6cd196fb6;p=thirdparty%2Fdhcpcd.git Fix compile on FreeBSD. --- diff --git a/dhcpcd.c b/dhcpcd.c index 82831873..b7653883 100644 --- a/dhcpcd.c +++ b/dhcpcd.c @@ -28,6 +28,7 @@ const char copyright[] = "Copyright (c) 2006-2009 Roy Marples"; #include +#include #include #include #include diff --git a/net.c b/net.c index c3d154a0..716911eb 100644 --- a/net.c +++ b/net.c @@ -275,12 +275,14 @@ discover_interfaces(int argc, char * const *argv) #ifdef AF_LINK if (ifa->ifa_addr->sa_family != AF_LINK) continue; +#ifdef __NetBSD__ /* FIXME: Why do I get 2 AF_LINK addresses per interface? */ for (ifp = ifs; ifp; ifp = ifp->next) if (strcmp(ifp->name, ifa->ifa_name) == 0) break; if (ifp) continue; +#endif #elif AF_PACKET if (ifa->ifa_addr->sa_family != AF_PACKET) continue; @@ -336,6 +338,9 @@ discover_interfaces(int argc, char * const *argv) break; } ifp->hwlen = sdl->sdl_alen; +#ifndef CLLADDR +# define CLLADDR(s) ((const char *)((s)->sdl_data + (s)->sdl_nlen)) +#endif memcpy(ifp->hwaddr, CLLADDR(sdl), ifp->hwlen); #elif AF_PACKET sll = (const struct sockaddr_ll *)(void *)ifa->ifa_addr;