]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Source now compiles on Solaris, just missing the if-sun.c support so
authorRoy Marples <roy@marples.name>
Wed, 21 May 2014 23:07:52 +0000 (23:07 +0000)
committerRoy Marples <roy@marples.name>
Wed, 21 May 2014 23:07:52 +0000 (23:07 +0000)
linking fails.

14 files changed:
Makefile
auth.c
common.c
common.h
compat/dprintf.c [new file with mode: 0644]
compat/dprintf.h [new file with mode: 0644]
configure
control.c
dhcp.c
dhcpcd-embedded.c.in [new file with mode: 0755]
dhcpcd.c
genembedc
if.c
ipv6nd.h

index 082dd3146fb213337e7654b0a1e4ddf2b17ac48c..b68ec718588ba11c6da28ac345538ef41225c986 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -6,12 +6,12 @@ SRCS+=                if.c if-options.c script.c
 SRCS+=         dhcp-common.c
 
 CFLAGS?=       -O2
-CSTD?=         c99
 MKDIRS=
 
 TOP?=          .
 include ${TOP}/iconfig.mk
 
+CSTD?=         c99
 CFLAGS+=       -std=${CSTD}
 
 SRCS+=         ${DHCPCD_SRCS}
diff --git a/auth.c b/auth.c
index c33e565f32afc00c66c948e64f30b7b31e783a8a..818178481f46a1d57420a08c0edecb33a8a943d5 100644 (file)
--- a/auth.c
+++ b/auth.c
 #include "dhcp6.h"
 #include "dhcpcd.h"
 
+#ifdef __sun
+#define htonll
+#define ntohll
+#endif
+
 #ifndef htonll
 #if (BYTE_ORDER == LITTLE_ENDIAN)
 static inline uint64_t
@@ -386,7 +391,9 @@ get_next_rdm_monotonic_counter(struct auth *auth)
 {
        FILE *fp;
        uint64_t rdm;
+#ifdef LOCK_EX
        int flocked;
+#endif
 
        fp = fopen(RDM_MONOFILE, "r+");
        if (fp == NULL) {
@@ -395,10 +402,14 @@ get_next_rdm_monotonic_counter(struct auth *auth)
                fp = fopen(RDM_MONOFILE, "w");
                if (fp == NULL)
                        return ++auth->last_replay; /* report error? */
+#ifdef LOCK_EX
                flocked = flock(fileno(fp), LOCK_EX);
+#endif
                rdm = 0;
        } else {
+#ifdef LOCK_EX
                flocked = flock(fileno(fp), LOCK_EX);
+#endif
                if (fscanf(fp, "0x%016" PRIu64, &rdm) != 1)
                        rdm = 0; /* truncated? report error? */
        }
@@ -416,8 +427,10 @@ get_next_rdm_monotonic_counter(struct auth *auth)
                /* report error? */
        }
        fflush(fp);
+#ifdef LOCK_EX
        if (flocked == 0)
                flock(fileno(fp), LOCK_UN);
+#endif
        fclose(fp);
        return rdm;
 }
index dfb4f697e028f8085f1ae1050b714e9756f11c44..b90027aa84aca8fdf998a21f2cc18272bd5df41f 100644 (file)
--- a/common.c
+++ b/common.c
@@ -30,7 +30,9 @@
 #  define _GNU_SOURCE
 #endif
 
-#include <sys/cdefs.h>
+#ifndef __sun
+#  include <sys/cdefs.h>
+#endif
 
 #ifdef __APPLE__
 #  include <mach/mach_time.h>
index 59473fa232475fa7110448b1e2d93e5b29c0f261..5a5450275334ccc0fdee2197248e07ff2e9b845e 100644 (file)
--- a/common.h
+++ b/common.h
 #define HOSTNAME_MAX_LEN       250     /* 255 - 3 (FQDN) - 2 (DNS enc) */
 #endif
 
+#ifndef MIN
+#define MIN(a,b)               ((/*CONSTCOND*/(a)<(b))?(a):(b))
+#define MAX(a,b)               ((/*CONSTCOND*/(a)>(b))?(a):(b))
+#endif
+
 #define UNCONST(a)             ((void *)(unsigned long)(const void *)(a))
 #define STRINGIFY(a)           #a
 #define TOSTRING(a)            STRINGIFY(a)
diff --git a/compat/dprintf.c b/compat/dprintf.c
new file mode 100644 (file)
index 0000000..db43fdd
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * dhcpcd - DHCP client daemon
+ * Copyright (c) 2006-2014 Roy Marples <roy@marples.name>
+ * All rights reserved
+
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <unistd.h>
+
+#include "dprintf.h"
+
+int
+dprintf(int fd, const char *fmt, ...)
+{
+       int e;
+       FILE *fp;
+       va_list va;
+
+       if ((e = dup(fd)) == -1)
+               return -1;
+
+       if ((fp = fdopen(e, "r+")) == NULL) {
+               close(e);
+               return -1;
+       }
+
+       va_start(va, fmt);
+       e = vfprintf(fp, fmt, va);
+       va_end(va);
+       fclose(fp);
+       return e;
+}
diff --git a/compat/dprintf.h b/compat/dprintf.h
new file mode 100644 (file)
index 0000000..f44d13a
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * dhcpcd - DHCP client daemon
+ * Copyright (c) 2006-2014 Roy Marples <roy@marples.name>
+ * All rights reserved
+
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef DPRINTF_H
+#define DPRINTF_H
+
+int dprintf(int, const char *, ...);
+#endif
index d01914ad3f50544ef574459c38bf43aeb66c7489..9e9c25ccc5b901d94ecea5217a56705157635322 100755 (executable)
--- a/configure
+++ b/configure
@@ -301,7 +301,7 @@ if [ -e "$LDELF" ]; then
 fi
 
 case "$OS" in
-linux*) ;;
+linux*|sunos*) ;;
 *)
        if ! [ -x "$LDELF" -o -x /libexec/ld-elf.so.[0-9]* ] && \
            [ -z "$PREFIX" -o "$PREFIX" = "/" ]
@@ -332,7 +332,7 @@ CFLAGS+=    -Wmissing-prototypes -Wmissing-declarations
 CFLAGS+=       -Wmissing-noreturn -Wmissing-format-attribute
 CFLAGS+=       -Wnested-externs
 CFLAGS+=       -Winline -Wwrite-strings -Wcast-align -Wcast-qual
-CFLAGS+=       -Wpointer-arith -Wstrict-overflow
+CFLAGS+=       -Wpointer-arith
 CFLAGS+=       -Wdeclaration-after-statement
 CFLAGS+=       -Wconversion
 EOF
@@ -340,6 +340,11 @@ EOF
        mirbsd*|openbsd*);; # OpenBSD has many redundant decs in system headers
        *)              echo "CFLAGS+=  -Wredundant-decls" >>$CONFIG_MK;;
        esac
+
+       case "$OS" in
+       sunos*);;
+       *)              echo "CFLAGS+=  -Wstrict-overflow" >>$CONFIG_MF;;
+       esac
 fi
 
 if [ -z "$EMBEDDED" -o "$EMBEDDED" = yes ]; then
@@ -366,6 +371,11 @@ kfreebsd*)
        echo "DHCPCD_SRCS+=     if-bsd.c" >>$CONFIG_MK
        echo "COMPAT_SRCS+=     compat/linkaddr.c" >>$CONFIG_MK
        ;;
+sunos*)
+#      echo "CSTD=             gnu99" >>$CONFIG_MK
+       echo "CPPFLAGS+=        -D_XPG4_2 -D__EXTENSIONS__ -DBSD_COMP" \
+           >>$CONFIG_MK
+       ;;
 *)
        echo "DHCPCD_SRCS+=     if-bsd.c" >>$CONFIG_MK
        ;;
@@ -397,6 +407,9 @@ int main(void) {
 EOF
 if $XCC _getifaddrs.c -o _getifaddrs 2>/dev/null; then
        echo "yes"
+elif $XCC _getifaddrs.c -o _getifaddrs -lsocket >/dev/null; then
+       echo "yes (-lsocket)"
+       echo "LDADD+=           -lsocket" >>$CONFIG_MK
 else
        echo "no"
        echo "libc support for getifaddrs is required - aborting" >&2
@@ -426,6 +439,29 @@ fi
 rm -f _clock_gettime.c _clock_gettime
 $abort && exit 1
 
+printf "Testing for inet_ntoa ... "
+cat <<EOF >_inet_ntoa.c
+#include <netinet/in.h>
+#include <arpa/inet.h>
+int main(void) {
+       struct in_addr in;
+       inet_ntoa(in);
+       return 0;
+}
+EOF
+if $XCC _inet_ntoa.c -o _inet_ntoa 2>/dev/null; then
+       echo "yes"
+elif $XCC _inet_ntoa.c -lnsl -o _inet_ntoa 2>/dev/null; then
+       echo "yes (-lnsl)"
+       echo "LDADD+=           -lnsl" >>$CONFIG_MK
+else
+       echo "no"
+       echo "libc support for inet_ntoa is required - aborting" >&2
+       abort=true
+fi
+rm -f _inet_ntoa.c _inet_ntoa
+$abort && exit 1
+
 if [ -z "$ARC4RANDOM" ]; then
        printf "Testing for arc4random ... "
        cat <<EOF >_arc4random.c
@@ -519,6 +555,27 @@ if [ "$STRLCPY" = no ]; then
        echo "#include          \"compat/strlcpy.h\"" >>$CONFIG_H
 fi
 
+if [ -z "$DPRINTF" ]; then
+       printf "Testing for dprintf ... "
+       cat <<EOF >_dprintf.c
+#include <stdio.h>
+int main(void) {
+       return dprintf(0, "%d", 0);
+}
+EOF
+       if $XCC _dprintf.c -o _dprintf 2>/dev/null; then
+               DPRINTF=yes
+       else
+               DPRINTF=no
+       fi
+       echo "$DPRINTF"
+       rm -f _dprintf.c _dprintf
+fi
+if [ "$DPRINTF" = no ]; then
+       echo "COMPAT_SRCS+=     compat/dprintf.c" >>$CONFIG_MK
+       echo "#include          \"compat/dprintf.h\"" >>$CONFIG_H
+fi
+
 if [ -z "$TAILQ_FOREACH_SAFE" ]; then
        printf "Testing for TAILQ_FOREACH_SAFE ... "
        cat <<EOF >_queue.c
index 958a32f6b718afa3ffad0b2e1dc9afbb39388cb2..d902b1970de2667aa8c46cf75e4416d58d7faa16 100644 (file)
--- a/control.c
+++ b/control.c
@@ -25,6 +25,7 @@
  * SUCH DAMAGE.
  */
 
+#include <sys/socket.h>
 #include <sys/stat.h>
 #include <sys/un.h>
 
@@ -126,7 +127,7 @@ control_handle(void *arg)
 }
 
 static socklen_t
-make_sock(struct dhcpcd_ctx *ctx, struct sockaddr_un *sun, const char *ifname)
+make_sock(struct dhcpcd_ctx *ctx, struct sockaddr_un *sa, const char *ifname)
 {
 
 #ifdef SOCK_CLOEXEC
@@ -153,24 +154,24 @@ make_sock(struct dhcpcd_ctx *ctx, struct sockaddr_un *sun, const char *ifname)
                return 0;
        }
 #endif
-       memset(sun, 0, sizeof(*sun));
-       sun->sun_family = AF_UNIX;
-       snprintf(sun->sun_path, sizeof(sun->sun_path), CONTROLSOCKET,
+       memset(sa, 0, sizeof(*sa));
+       sa->sun_family = AF_UNIX;
+       snprintf(sa->sun_path, sizeof(sa->sun_path), CONTROLSOCKET,
            ifname ? "-" : "", ifname ? ifname : "");
-       strlcpy(ctx->control_sock, sun->sun_path, sizeof(ctx->control_sock));
-       return (socklen_t)SUN_LEN(sun);
+       strlcpy(ctx->control_sock, sa->sun_path, sizeof(ctx->control_sock));
+       return (socklen_t)SUN_LEN(sa);
 }
 
 int
 control_start(struct dhcpcd_ctx *ctx, const char *ifname)
 {
-       struct sockaddr_un sun;
+       struct sockaddr_un sa;
        socklen_t len;
 
-       if ((len = make_sock(ctx, &sun, ifname)) == 0)
+       if ((len = make_sock(ctx, &sa, ifname)) == 0)
                return -1;
        unlink(ctx->control_sock);
-       if (bind(ctx->control_fd, (struct sockaddr *)&sun, len) == -1 ||
+       if (bind(ctx->control_fd, (struct sockaddr *)&sa, len) == -1 ||
            chmod(ctx->control_sock,
                S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP) == -1 ||
            (ctx->control_group &&
@@ -217,12 +218,12 @@ control_stop(struct dhcpcd_ctx *ctx)
 int
 control_open(struct dhcpcd_ctx *ctx, const char *ifname)
 {
-       struct sockaddr_un sun;
+       struct sockaddr_un sa;
        socklen_t len;
 
-       if ((len = make_sock(ctx, &sun, ifname)) == 0)
+       if ((len = make_sock(ctx, &sa, ifname)) == 0)
                return -1;
-       if (connect(ctx->control_fd, (struct sockaddr *)&sun, len) == -1) {
+       if (connect(ctx->control_fd, (struct sockaddr *)&sa, len) == -1) {
                close(ctx->control_fd);
                ctx->control_fd = -1;
                return -1;
diff --git a/dhcp.c b/dhcp.c
index 2d0fe3ccf2a378ca237d6e92c22e32fcbd623a5b..e03c34780ef0a1556ede61739b075bd8e92090c4 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
 #define RELEASE_DELAY_S                0
 #define RELEASE_DELAY_NS       10000000
 
+#ifndef IPDEFTTL
+#define IPDEFTTL 64 /* RFC1340 */
+#endif
+
 struct dhcp_op {
        uint8_t value;
        const char *name;
diff --git a/dhcpcd-embedded.c.in b/dhcpcd-embedded.c.in
new file mode 100755 (executable)
index 0000000..3c0a7a7
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * DO NOT EDIT
+ * Automatically generated from dhcpcd-embedded.conf
+ * Ths allows us to simply generate DHCP structure without any C programming
+ */
+
+/*
+ * dhcpcd - DHCP client daemon
+ * Copyright (c) 2006-2013 Roy Marples <roy@marples.name>
+ * All rights reserved
+
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <unistd.h>
+
+const char * const dhcpcd_embedded_conf[] = {
index 5e142009b6a5bb6a2475dab762d10bf33a95a1e5..ac09d276de53828b589d73248749115114c36b8f 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -1139,7 +1139,11 @@ main(int argc, char **argv)
        siga = NULL;
 #endif
        closefrom(3);
+#ifdef LOG_PERROR
        openlog(PACKAGE, LOG_PERROR | LOG_PID, LOG_DAEMON);
+#else
+       openlog(PACKAGE, LOG_PID, LOG_DAEMON);
+#endif
        setlogmask(LOG_UPTO(LOG_INFO));
 
        /* Test for --help and --version */
@@ -1392,6 +1396,7 @@ main(int argc, char **argv)
                if (ctx.pid_fd == -1)
                        syslog(LOG_ERR, "open `%s': %m", pidfile);
                else {
+#ifdef LOCK_EX
                        /* Lock the file so that only one instance of dhcpcd
                         * runs on an interface */
                        if (flock(ctx.pid_fd, LOCK_EX | LOCK_NB) == -1) {
@@ -1400,6 +1405,7 @@ main(int argc, char **argv)
                                ctx.pid_fd = -1;
                                goto exit_failure;
                        }
+#endif
 #ifndef O_CLOEXEC
                        if (fcntl(ctx.pid_fd, F_GETFD, &opt) == -1 ||
                            fcntl(ctx.pid_fd, F_SETFD, opt | FD_CLOEXEC) == -1)
index f565d33e4e20484b378719bacea2758933fe4a12..5bd7b6f6def09318b5d39c393ed087d3cf2a898c 100755 (executable)
--- a/genembedc
+++ b/genembedc
@@ -4,45 +4,7 @@ set -e
 : ${TOOL_SED:=sed}
 CONF=${1:-dhcpcd-definitions.conf}
 
-cat <<EOF
-/*
- * DO NOT EDIT
- * Automatically generated from dhcpcd-embedded.conf
- * Ths allows us to simply generate DHCP structure without any C programming
- */
-
-/*
- * dhcpcd - DHCP client daemon
- * Copyright (c) 2006-2013 Roy Marples <roy@marples.name>
- * All rights reserved
-
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <unistd.h>
-
-const char * const dhcpcd_embedded_conf[] = {
-EOF
-
+cat dhcpcd-embedded.c.in
 $TOOL_SED \
        -e 's/#.*$//' \
        -e '/^$/d' \
diff --git a/if.c b/if.c
index add301ea6383876c27e4be6f73878c123ee418a9..0aad1f6b8690995367daad85bc777d789a05c6f4 100644 (file)
--- a/if.c
+++ b/if.c
@@ -341,15 +341,23 @@ if_discover(struct dhcpcd_ctx *ctx, int argc, char * const *argv)
                        ifp->index = sdl->sdl_index;
                        sdl_type = sdl->sdl_type;
                        switch(sdl->sdl_type) {
+#ifdef IFT_BRIDGE
                        case IFT_BRIDGE: /* FALLTHROUGH */
+#endif
+#ifdef IFT_L2VLAN
                        case IFT_L2VLAN: /* FALLTHOUGH */
+#endif
+#ifdef IFT_L3IPVLAN
                        case IFT_L3IPVLAN: /* FALLTHROUGH */
+#endif
                        case IFT_ETHER:
                                ifp->family = ARPHRD_ETHER;
                                break;
+#ifdef IFT_IEEE1394
                        case IFT_IEEE1394:
                                ifp->family = ARPHRD_IEEE1394;
                                break;
+#endif
 #ifdef IFT_INFINIBAND
                        case IFT_INFINIBAND:
                                ifp->family = ARPHRD_INFINIBAND;
index 6c52c1fde2a1b314ce8ce4dd0d48633a9571ed24..f29065d9efe1fbade57ff0db65584fb5ade9ad6a 100644 (file)
--- a/ipv6nd.h
+++ b/ipv6nd.h
@@ -103,7 +103,7 @@ void ipv6nd_neighbour(struct dhcpcd_ctx *, struct in6_addr *, int);
 #define ipv6nd_startrs(a) {}
 #define ipv6nd_addrexists(a, b) (0)
 #define ipv6nd_free(a)
-#define ipv6nd_has_ra(a) (0)
+#define ipv6nd_hasra(a) (0)
 #define ipv6nd_drop(a)
 #endif