diff --git a/debian/rules b/debian/rules index b34c346..6416ba9 100755 --- a/debian/rules +++ b/debian/rules @@ -12,7 +12,7 @@ package=dnsmasq-base # policy manual, section 10.1 -ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) +ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) CFLAGS = -g -O0 -Wall -W else CFLAGS = -g -O2 -Wall -W @@ -23,43 +23,51 @@ TARGET = install-i18n DEB_BUILD_ARCH_OS := $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS) -ifeq (,$(findstring nodbus,$(DEB_BUILD_OPTIONS))) +ifeq (,$(filter nodbus,$(DEB_BUILD_OPTIONS))) COPTS += -DHAVE_DBUS endif -ifeq (,$(findstring noconntrack,$(DEB_BUILD_OPTIONS))) +ifeq (,$(filter noconntrack,$(DEB_BUILD_OPTIONS))) ifeq ($(DEB_BUILD_ARCH_OS),linux) COPTS += -DHAVE_CONNTRACK endif endif -ifneq (,$(findstring noipv6,$(DEB_BUILD_OPTIONS))) +ifneq (,$(filter noipv6,$(DEB_BUILD_OPTIONS))) COPTS += -DNO_IPV6 endif -ifneq (,$(findstring notftp,$(DEB_BUILD_OPTIONS))) +ifneq (,$(filter notftp,$(DEB_BUILD_OPTIONS))) COPTS += -DNO_TFTP endif -ifneq (,$(findstring nodhcp,$(DEB_BUILD_OPTIONS))) +ifneq (,$(filter nodhcp,$(DEB_BUILD_OPTIONS))) COPTS += -DNO_DHCP endif -ifneq (,$(findstring noscript,$(DEB_BUILD_OPTIONS))) +ifneq (,$(filter nodhcp6,$(DEB_BUILD_OPTIONS))) + COPTS += -DNO_DHCP6 +endif + +ifneq (,$(filter noscript,$(DEB_BUILD_OPTIONS))) COPTS += -DNO_SCRIPT endif -ifneq (,$(findstring nortc,$(DEB_BUILD_OPTIONS))) +ifneq (,$(filter nortc,$(DEB_BUILD_OPTIONS))) COPTS += -DHAVE_BROKEN_RTC endif -ifneq (,$(findstring noi18n,$(DEB_BUILD_OPTIONS))) +ifneq (,$(filter noi18n,$(DEB_BUILD_OPTIONS))) TARGET = install - ifeq (,$(findstring noidn, $(DEB_BUILD_OPTIONS))) + ifeq (,$(filter noidn, $(DEB_BUILD_OPTIONS))) COPTS += -DHAVE_IDN endif endif +ifneq (,$(filter uselua,$(DEB_BUILD_OPTIONS))) + COPTS += -DHAVE_LUASCRIPT +endif + clean: $(checkdir) rm -rf debian/daemon debian/base debian/utils debian/*~ debian/files debian/substvars debian/utils-substvars diff --git a/src/dhcp6.c b/src/dhcp6.c index 94cff5b..7f66436 100644 --- a/src/dhcp6.c +++ b/src/dhcp6.c @@ -140,8 +140,6 @@ static int join_multicast(struct in6_addr *local, int prefix, } - - void dhcp6_packet(time_t now) { struct dhcp_context *context; @@ -215,8 +213,7 @@ void dhcp6_packet(time_t now) msg.msg_iov = &daemon->dhcp_packet; sz = dhcp6_reply(parm.current, if_index, ifr.ifr_name, sz, IN6_IS_ADDR_MULTICAST(&from), now); - /* ifr.ifr_name, if_index, (size_t)sz, - now, unicast_dest, &is_inform, pxe_fd, iface_addr); */ + lease_update_file(now); lease_update_dns(); diff --git a/src/option.c b/src/option.c index 1ebe971..cce8e7c 100644 --- a/src/option.c +++ b/src/option.c @@ -2336,7 +2336,7 @@ static char *one_opt(int option, char *arg, char *gen_prob, int command_line) daemon->dhcp6 = new; if (strcmp(a[1], "static") == 0) { - new->end = new->start; + memcpy(&new->end6, &new->start6, IN6ADDRSZ); new->flags |= CONTEXT_STATIC; } else if (!inet_pton(AF_INET6, a[1], &new->end6)) @@ -2357,10 +2357,9 @@ static char *one_opt(int option, char *arg, char *gen_prob, int command_line) problem = _("prefix must be at least 64"); } } - if (!is_same_net6(&new->start6, &new->end6, new->prefix)) - problem = _("inconsistent DHCP range"); - - if (addr6part(&new->start6) > addr6part(&new->end6)) + if (!problem && !is_same_net6(&new->start6, &new->end6, new->prefix)) + problem = _("inconsistent DHCPv6 range"); + else if (addr6part(&new->start6) > addr6part(&new->end6)) { struct in6_addr tmp = new->start6; new->start6 = new->end6; diff --git a/src/rfc3315.c b/src/rfc3315.c index 7f5c35f..54e0e91 100644 --- a/src/rfc3315.c +++ b/src/rfc3315.c @@ -39,12 +39,12 @@ static void log6_packet(char *type, unsigned char *clid, int clid_len, struct in static void *opt6_find (void *opts, void *end, unsigned int search, unsigned int minsize); static void *opt6_next(void *opts, void *end); static unsigned int opt6_uint(unsigned char *opt, int offset, int size); + #define opt6_len(opt) ((int)(opt6_uint(opt, -2, 2))) #define opt6_type(opt) (opt6_uint(opt, -4, 2)) #define opt6_ptr(opt, i) ((void *)&(((unsigned char *)(opt))[4+(i)])) - size_t dhcp6_reply(struct dhcp_context *context, int interface, char *iface_name, size_t sz, int is_unicast, time_t now) { struct dhcp_netid *relay_tags = NULL; @@ -929,6 +929,7 @@ static int dhcp6_no_relay(int msg_type, struct dhcp_netid *tags, struct dhcp_con if (ignore) return 0; *outmsgtypep = DHCP6REPLY; + log6_packet("DHCPINFORMATION-REQUEST", clid, clid_len, NULL, xid, iface_name, hostname); break; }