From: Roy Marples Date: Mon, 8 Sep 2014 13:58:18 +0000 (+0000) Subject: Always define IFLA_INET6_ADDR_GEN_MODE because linux defines it as an X-Git-Tag: v6.4.4~36 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0728425bfecdc6731c61b3f08ad7e4681cb80b95;p=thirdparty%2Fdhcpcd.git Always define IFLA_INET6_ADDR_GEN_MODE because linux defines it as an enum only, thus we have no way of knowing if it exists or not in an --- diff --git a/if-linux.c b/if-linux.c index 356009f9..5bbac9b1 100644 --- a/if-linux.c +++ b/if-linux.c @@ -51,6 +51,11 @@ # define IFLA_WIRELESS (IFLA_MASTER + 1) #endif +/* Linux has these in an enum and there is just no way to work + * out of they exist at compile time. Silly silly silly. */ +#define IFLA_INET6_ADDR_GEN_MODE 8 +#define IN6_ADDR_GEN_MODE_NONE 1 + /* For some reason, glibc doesn't include newer flags from linux/if.h * However, we cannot include linux/if.h directly as it conflicts * with the glibc version. D'oh! */ @@ -1231,7 +1236,6 @@ struct nlml char buffer[32]; }; -#if IFLA_INET6_MAX >= IFLA_INET6_TOKEN - 1 static int add_attr_8(struct nlmsghdr *n, unsigned short maxlen, unsigned short type, uint8_t data) @@ -1278,15 +1282,6 @@ if_disable_autolinklocal(struct dhcpcd_ctx *ctx, const char *ifname) return send_netlink(ctx, &nlm.hdr); } -#else -static int -if_disable_autolinklocal(__unused struct dhcpcd_ctx *ctx, - __unused const char *ifname) -{ - errno = ENOTSUP; - return -1; -} -#endif static const char *prefix = "/proc/sys/net/ipv6/conf";