Report correct error if prefix in dhcp-range is less than 64

Update debian/rules to provide no_dhcp6 and use_lua build opts.
Log DHCPv6 information request packets.
This commit is contained in:
Simon Kelley
2012-02-10 21:19:25 +00:00
parent c6cc03ed0c
commit 627797800d
4 changed files with 25 additions and 20 deletions

View File

@@ -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();

View File

@@ -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;

View File

@@ -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;
}