Compare commits

..
8 Commits
16 changed files with 4909 additions and 4376 deletions

No files matched your search

+5
View File
@@ -125,6 +125,11 @@ version 2.67
range. This was originally to avoid SLAAC addresses, but range. This was originally to avoid SLAAC addresses, but
we now explicitly autoconfig and privacy addresses instead. we now explicitly autoconfig and privacy addresses instead.
Update Polish translation. Thanks to Jan Psota.
Fix problem in DHCPv6 vendorclass/userclass matching
code. Thanks to Tanguy Bouzeloc for the patch.
version 2.66 version 2.66
Add the ability to act as an authoritative DNS Add the ability to act as an authoritative DNS
+5
View File
@@ -114,6 +114,11 @@ merge :
echo -n msgmerge $(PO)/$$f && $(MSGMERGE) --no-wrap -U $(PO)/$$f $(BUILDDIR)/dnsmasq.pot; \ echo -n msgmerge $(PO)/$$f && $(MSGMERGE) --no-wrap -U $(PO)/$$f $(BUILDDIR)/dnsmasq.pot; \
done done
# Cannonicalise .po file.
%.po :
@cd $(BUILDDIR) && $(MAKE) -f $(top)/Makefile dnsmasq.pot
mv $(PO)/$*.po $(PO)/$*.po.orig && $(MSGMERGE) --no-wrap $(PO)/$*.po.orig $(BUILDDIR)/dnsmasq.pot >$(PO)/$*.po;
$(BUILDDIR): $(BUILDDIR):
mkdir -p $(BUILDDIR) mkdir -p $(BUILDDIR)
+1 -1
View File
@@ -25,7 +25,7 @@ DEB_BUILD_ARCH_OS := $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS)
# Force package version based on git tags. # Force package version based on git tags.
ifneq (,$(filter gitversion,$(DEB_BUILD_OPTIONS))) ifneq (,$(filter gitversion,$(DEB_BUILD_OPTIONS)))
PACKAGE_VERSION = $(shell bld/get-version `pwd` | sed 's/[a-z]/~&/; s/-/./g; s/$$/-1/; s/^/-v/';) PACKAGE_VERSION = $(shell bld/get-version `pwd` | sed 's/test/~&/; s/[a-z]/~&/; s/-/./g; s/$$/-1/; s/^/-v/';)
endif endif
ifeq (,$(filter nodbus,$(DEB_BUILD_OPTIONS))) ifeq (,$(filter nodbus,$(DEB_BUILD_OPTIONS)))
+465 -413
View File
File diff suppressed because it is too large. Load diff
+460 -410
View File
File diff suppressed because it is too large. Load diff
+516 -467
View File
File diff suppressed because it is too large. Load diff
+464 -410
View File
File diff suppressed because it is too large. Load diff
+490 -441
View File
File diff suppressed because it is too large. Load diff
+516 -467
View File
File diff suppressed because it is too large. Load diff
+479 -432
View File
File diff suppressed because it is too large. Load diff
+469 -420
View File
File diff suppressed because it is too large. Load diff
+516 -467
View File
File diff suppressed because it is too large. Load diff
+479 -432
View File
File diff suppressed because it is too large. Load diff
+26 -10
View File
@@ -830,7 +830,7 @@ void log_context(int family, struct dhcp_context *context)
if (indextoname(daemon->icmp6fd, context->if_index, ifrn_name)) if (indextoname(daemon->icmp6fd, context->if_index, ifrn_name))
sprintf(p, "%s for %s", (context->flags & CONTEXT_OLD) ? "old prefix" : "constructed", ifrn_name); sprintf(p, "%s for %s", (context->flags & CONTEXT_OLD) ? "old prefix" : "constructed", ifrn_name);
} }
else if (context->flags & CONTEXT_TEMPLATE) else if (context->flags & CONTEXT_TEMPLATE && !(context->flags & CONTEXT_RA_STATELESS))
{ {
template = p; template = p;
p += sprintf(p, ", "); p += sprintf(p, ", ");
@@ -842,21 +842,37 @@ void log_context(int family, struct dhcp_context *context)
if (!(context->flags & CONTEXT_OLD) && if (!(context->flags & CONTEXT_OLD) &&
((context->flags & CONTEXT_DHCP) || family == AF_INET)) ((context->flags & CONTEXT_DHCP) || family == AF_INET))
{ {
inet_ntop(family, start, daemon->dhcp_buff, 256); #ifdef HAVE_DHCP6
if (context->flags & CONTEXT_RA_STATELESS)
{
if (context->flags & CONTEXT_TEMPLATE)
strncpy(daemon->dhcp_buff, context->template_interface, 256);
else
strcpy(daemon->dhcp_buff, daemon->addrbuff);
}
else
#endif
inet_ntop(family, start, daemon->dhcp_buff, 256);
inet_ntop(family, end, daemon->dhcp_buff3, 256); inet_ntop(family, end, daemon->dhcp_buff3, 256);
my_syslog(MS_DHCP | LOG_INFO, my_syslog(MS_DHCP | LOG_INFO,
(context->flags & CONTEXT_RA_STATELESS) ? (context->flags & CONTEXT_RA_STATELESS) ?
_("%s stateless on %s%.0s%.0s%s") : _("%s stateless on %s%.0s%.0s%s") :
(context->flags & CONTEXT_STATIC) ? (context->flags & CONTEXT_STATIC) ?
_("%s, static leases only on %.0s%s%s%.0s") : _("%s, static leases only on %.0s%s%s%.0s") :
(context->flags & CONTEXT_PROXY) ? (context->flags & CONTEXT_PROXY) ?
_("%s, proxy on subnet %.0s%s%.0s%.0s") : _("%s, proxy on subnet %.0s%s%.0s%.0s") :
_("%s, IP range %s -- %s%s%.0s"), _("%s, IP range %s -- %s%s%.0s"),
(family != AF_INET) ? "DHCPv6" : "DHCP", (family != AF_INET) ? "DHCPv6" : "DHCP",
daemon->dhcp_buff, daemon->dhcp_buff3, daemon->namebuff, template); daemon->dhcp_buff, daemon->dhcp_buff3, daemon->namebuff, template);
} }
#ifdef HAVE_DHCP6 #ifdef HAVE_DHCP6
if (context->flags & CONTEXT_TEMPLATE)
{
strcpy(daemon->addrbuff, context->template_interface);
template = "";
}
if ((context->flags & CONTEXT_RA_NAME) && !(context->flags & CONTEXT_OLD)) if ((context->flags & CONTEXT_RA_NAME) && !(context->flags & CONTEXT_OLD))
my_syslog(MS_DHCP | LOG_INFO, _("DHCPv4-derived IPv6 names on %s%s"), daemon->addrbuff, template); my_syslog(MS_DHCP | LOG_INFO, _("DHCPv4-derived IPv6 names on %s%s"), daemon->addrbuff, template);
+10 -3
View File
@@ -61,8 +61,13 @@ struct script_data
#else #else
time_t expires; time_t expires;
#endif #endif
#ifdef HAVE_DHCP6 #ifdef HAVE_TFTP
off_t file_len;
#endif
#ifdef HAVE_IPV6
struct in6_addr addr6; struct in6_addr addr6;
#endif
#ifdef HAVE_DHCP6
int iaid, vendorclass_count; int iaid, vendorclass_count;
#endif #endif
unsigned char hwaddr[DHCP_CHADDR_MAX]; unsigned char hwaddr[DHCP_CHADDR_MAX];
@@ -289,9 +294,11 @@ int create_helper(int event_fd, int err_fd, uid_t uid, gid_t gid, long max_fd)
inet_ntop(AF_INET6, &data.addr6, daemon->addrbuff, ADDRSTRLEN); inet_ntop(AF_INET6, &data.addr6, daemon->addrbuff, ADDRSTRLEN);
#endif #endif
#ifdef HAVE_TFTP
/* file length */ /* file length */
if (data.action == ACTION_TFTP) if (data.action == ACTION_TFTP)
sprintf(is6 ? daemon->packet : daemon->dhcp_buff, "%u", data.iaid); sprintf(is6 ? daemon->packet : daemon->dhcp_buff, "%lu", (unsigned long)data.file_len);
#endif
#ifdef HAVE_LUASCRIPT #ifdef HAVE_LUASCRIPT
if (daemon->luascript) if (daemon->luascript)
@@ -739,7 +746,7 @@ void queue_tftp(off_t file_len, char *filename, union mysockaddr *peer)
buf->action = ACTION_TFTP; buf->action = ACTION_TFTP;
buf->hostname_len = filename_len; buf->hostname_len = filename_len;
buf->iaid = file_len; buf->file_len = file_len;
if ((buf->flags = peer->sa.sa_family) == AF_INET) if ((buf->flags = peer->sa.sa_family) == AF_INET)
buf->addr = peer->in.sin_addr; buf->addr = peer->in.sin_addr;
+8 -3
View File
@@ -66,6 +66,10 @@ static void calculate_times(struct dhcp_context *context, unsigned int *min_time
#define opt6_type(opt) (opt6_uint(opt, -4, 2)) #define opt6_type(opt) (opt6_uint(opt, -4, 2))
#define opt6_ptr(opt, i) ((void *)&(((unsigned char *)(opt))[4+(i)])) #define opt6_ptr(opt, i) ((void *)&(((unsigned char *)(opt))[4+(i)]))
#define opt6_user_vendor_ptr(opt, i) ((void *)&(((unsigned char *)(opt))[2+(i)]))
#define opt6_user_vendor_len(opt) ((int)(opt6_uint(opt, -4, 2)))
#define opt6_user_vendor_next(opt, end) (opt6_next(((void *) opt) - 2, end))
unsigned short dhcp6_reply(struct dhcp_context *context, int interface, char *iface_name, unsigned short dhcp6_reply(struct dhcp_context *context, int interface, char *iface_name,
struct in6_addr *fallback, size_t sz, struct in6_addr *client_addr, time_t now) struct in6_addr *fallback, size_t sz, struct in6_addr *client_addr, time_t now)
@@ -355,9 +359,10 @@ static int dhcp6_no_relay(struct state *state, int msg_type, void *inbuff, size_
offset = 4; offset = 4;
} }
for (enc_opt = opt6_ptr(opt, offset); enc_opt; enc_opt = opt6_next(enc_opt, enc_end)) /* Note that format if user/vendor classes is different to DHCP options - no option types. */
for (i = 0; i <= (opt6_len(enc_opt) - vendor->len); i++) for (enc_opt = opt6_ptr(opt, offset); enc_opt; enc_opt = opt6_user_vendor_next(enc_opt, enc_end))
if (memcmp(vendor->data, opt6_ptr(enc_opt, i), vendor->len) == 0) for (i = 0; i <= (opt6_user_vendor_len(enc_opt) - vendor->len); i++)
if (memcmp(vendor->data, opt6_user_vendor_ptr(enc_opt, i), vendor->len) == 0)
{ {
vendor->netid.next = state->tags; vendor->netid.next = state->tags;
state->tags = &vendor->netid; state->tags = &vendor->netid;