mirror of
http://thekelleys.org.uk/git/dnsmasq.git
synced 2026-11-19 19:51:01 +00:00
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f74b74e521 | ||
|
|
c9342cb556 | ||
|
|
2b844b8c83 | ||
|
|
65e9a8957c | ||
|
|
da868a2fbe |
No files matched your search
+1
-1
@@ -673,7 +673,7 @@ machine on which dnsmasq is running) for each
|
|||||||
local machine. Local machines are those in /etc/hosts or with DHCP
|
local machine. Local machines are those in /etc/hosts or with DHCP
|
||||||
leases.
|
leases.
|
||||||
.TP
|
.TP
|
||||||
.B \-W, --srv-host=<_service>.<_prot>.[<domain>],[<target>[,<port>[,<priority>[,<weight>]]]]
|
.B \-W, --srv-host=<_service>.<_prot>[.<domain>],[<target>[,<port>[,<priority>[,<weight>]]]]
|
||||||
Return a SRV DNS record. See RFC2782 for details. If not supplied, the
|
Return a SRV DNS record. See RFC2782 for details. If not supplied, the
|
||||||
domain defaults to that given by
|
domain defaults to that given by
|
||||||
.B --domain.
|
.B --domain.
|
||||||
|
|||||||
+1
-1
@@ -1777,9 +1777,9 @@ void clear_cache_and_reload(time_t now)
|
|||||||
#ifdef HAVE_DHCP
|
#ifdef HAVE_DHCP
|
||||||
if (daemon->dhcp || daemon->doing_dhcp6)
|
if (daemon->dhcp || daemon->doing_dhcp6)
|
||||||
{
|
{
|
||||||
|
reread_dhcp();
|
||||||
if (option_bool(OPT_ETHERS))
|
if (option_bool(OPT_ETHERS))
|
||||||
dhcp_read_ethers();
|
dhcp_read_ethers();
|
||||||
reread_dhcp();
|
|
||||||
dhcp_update_configs(daemon->dhcp_conf);
|
dhcp_update_configs(daemon->dhcp_conf);
|
||||||
lease_update_from_configs();
|
lease_update_from_configs();
|
||||||
lease_update_file(now);
|
lease_update_file(now);
|
||||||
|
|||||||
+10
-10
@@ -763,6 +763,16 @@ static size_t process_reply(struct dns_header *header, time_t now, struct server
|
|||||||
if (!is_sign && !option_bool(OPT_DNSSEC_PROXY))
|
if (!is_sign && !option_bool(OPT_DNSSEC_PROXY))
|
||||||
header->hb4 &= ~HB4_AD;
|
header->hb4 &= ~HB4_AD;
|
||||||
|
|
||||||
|
/* Complain loudly if the upstream server is non-recursive. */
|
||||||
|
if (!(header->hb4 & HB4_RA) && rcode == NOERROR &&
|
||||||
|
server && !(server->flags & SERV_WARNED_RECURSIVE))
|
||||||
|
{
|
||||||
|
(void)prettyprint_addr(&server->addr, daemon->namebuff);
|
||||||
|
my_syslog(LOG_WARNING, _("nameserver %s refused to do a recursive query"), daemon->namebuff);
|
||||||
|
if (!option_bool(OPT_LOG))
|
||||||
|
server->flags |= SERV_WARNED_RECURSIVE;
|
||||||
|
}
|
||||||
|
|
||||||
header->hb4 |= HB4_RA; /* recursion if available */
|
header->hb4 |= HB4_RA; /* recursion if available */
|
||||||
|
|
||||||
if (OPCODE(header) != QUERY)
|
if (OPCODE(header) != QUERY)
|
||||||
@@ -778,16 +788,6 @@ static size_t process_reply(struct dns_header *header, time_t now, struct server
|
|||||||
return resize_packet(header, n, pheader, plen);
|
return resize_packet(header, n, pheader, plen);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Complain loudly if the upstream server is non-recursive. */
|
|
||||||
if (!(header->hb4 & HB4_RA) && rcode == NOERROR &&
|
|
||||||
server && !(server->flags & SERV_WARNED_RECURSIVE))
|
|
||||||
{
|
|
||||||
(void)prettyprint_addr(&server->addr, daemon->namebuff);
|
|
||||||
my_syslog(LOG_WARNING, _("nameserver %s refused to do a recursive query"), daemon->namebuff);
|
|
||||||
if (!option_bool(OPT_LOG))
|
|
||||||
server->flags |= SERV_WARNED_RECURSIVE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (header->hb3 & HB3_TC)
|
if (header->hb3 & HB3_TC)
|
||||||
log_query(F_UPSTREAM, NULL, NULL, "truncated", 0);
|
log_query(F_UPSTREAM, NULL, NULL, "truncated", 0);
|
||||||
else if (!bogusanswer || (header->hb4 & HB4_CD))
|
else if (!bogusanswer || (header->hb4 & HB4_CD))
|
||||||
|
|||||||
@@ -6262,6 +6262,8 @@ void read_opts(int argc, char **argv, char *compile_opts)
|
|||||||
strchr(srv->name, '.') &&
|
strchr(srv->name, '.') &&
|
||||||
strchr(srv->name, '.') == strrchr(srv->name, '.'))
|
strchr(srv->name, '.') == strrchr(srv->name, '.'))
|
||||||
{
|
{
|
||||||
|
if (strlen(srv->name) + 1 + strlen(daemon->domain_suffix) > MAXDNAME)
|
||||||
|
die(_("srv-host name %s too long after domain appended"), srv->name, EC_MISC);
|
||||||
strcpy(buff, srv->name);
|
strcpy(buff, srv->name);
|
||||||
strcat(buff, ".");
|
strcat(buff, ".");
|
||||||
strcat(buff, daemon->domain_suffix);
|
strcat(buff, daemon->domain_suffix);
|
||||||
|
|||||||
+40
-43
@@ -2276,59 +2276,56 @@ int relay_reply6(struct sockaddr_in6 *peer, ssize_t sz, char *arrival_interface)
|
|||||||
{
|
{
|
||||||
void *opt, *opts = inbuff + 34;
|
void *opt, *opts = inbuff + 34;
|
||||||
void *end = inbuff + sz;
|
void *end = inbuff + sz;
|
||||||
for (opt = opts; opt; opt = opt6_next(opt, end))
|
|
||||||
if (opt6_type(opt) == OPTION6_RELAY_MSG && opt6_len(opt) > 0)
|
|
||||||
{
|
|
||||||
int encap_type = *((unsigned char *)opt6_ptr(opt, 0));
|
|
||||||
put_opt6(opt6_ptr(opt, 0), opt6_len(opt));
|
|
||||||
memcpy(&peer->sin6_addr, &inbuff[18], IN6ADDRSZ);
|
|
||||||
peer->sin6_scope_id = relay->iface_index;
|
|
||||||
|
|
||||||
if (encap_type == DHCP6RELAYREPL)
|
if ((opt = opt6_find(opts, end, OPTION6_RELAY_MSG, 4)))
|
||||||
{
|
{
|
||||||
peer->sin6_port = ntohs(DHCPV6_SERVER_PORT);
|
int encap_type = opt6_uint(opt, 0, 1);
|
||||||
return 1;
|
put_opt6(opt6_ptr(opt, 0), opt6_len(opt));
|
||||||
}
|
memcpy(&peer->sin6_addr, &inbuff[18], IN6ADDRSZ);
|
||||||
|
peer->sin6_scope_id = relay->iface_index;
|
||||||
|
|
||||||
peer->sin6_port = ntohs(DHCPV6_CLIENT_PORT);
|
if (encap_type == DHCP6RELAYREPL)
|
||||||
|
{
|
||||||
|
peer->sin6_port = ntohs(DHCPV6_SERVER_PORT);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
peer->sin6_port = ntohs(DHCPV6_CLIENT_PORT);
|
||||||
|
|
||||||
#ifdef HAVE_SCRIPT
|
#ifdef HAVE_SCRIPT
|
||||||
if (daemon->lease_change_command && encap_type == DHCP6REPLY)
|
if (daemon->lease_change_command && encap_type == DHCP6REPLY)
|
||||||
{
|
{
|
||||||
/* decapsulate relayed message */
|
/* skip over message type and transaction-id. to get to options. */
|
||||||
opts = opt6_ptr(opt, 4);
|
opts = opt6_ptr(opt, 4);
|
||||||
end = opt6_ptr(opt, opt6_len(opt));
|
end = opt6_ptr(opt, opt6_len(opt));
|
||||||
|
|
||||||
for (opt = opts; opt; opt = opt6_next(opt, end))
|
if ((opt = opt6_find(opts, end, OPTION6_IA_PD, 12)))
|
||||||
if (opt6_type(opt) == OPTION6_IA_PD && opt6_len(opt) > 12)
|
{
|
||||||
{
|
opts = opt6_ptr(opt, 12);
|
||||||
void *ia_opts = opt6_ptr(opt, 12);
|
end = opt6_ptr(opt, opt6_len(opt));
|
||||||
void *ia_end = opt6_ptr(opt, opt6_len(opt));
|
|
||||||
void *ia_opt;
|
|
||||||
|
|
||||||
for (ia_opt = ia_opts; ia_opt; ia_opt = opt6_next(ia_opt, ia_end))
|
for (opt = opt6_find(opts, end, OPTION6_IAPREFIX, 25); opt; opt = opt6_find(opt6_next(opt, end), end, OPTION6_IAPREFIX, 25))
|
||||||
/* valid lifetime must not be zero. */
|
/* valid lifetime must not be zero. */
|
||||||
if (opt6_type(ia_opt) == OPTION6_IAPREFIX && opt6_len(ia_opt) >= 25 && opt6_uint(ia_opt, 4, 4) != 0)
|
if (opt6_uint(opt, 4, 4) != 0)
|
||||||
|
{
|
||||||
|
if (daemon->free_snoops ||
|
||||||
|
(daemon->free_snoops = whine_malloc(sizeof(struct snoop_record))))
|
||||||
{
|
{
|
||||||
if (daemon->free_snoops ||
|
struct snoop_record *snoop = daemon->free_snoops;
|
||||||
(daemon->free_snoops = whine_malloc(sizeof(struct snoop_record))))
|
|
||||||
{
|
|
||||||
struct snoop_record *snoop = daemon->free_snoops;
|
|
||||||
|
|
||||||
daemon->free_snoops = snoop->next;
|
daemon->free_snoops = snoop->next;
|
||||||
snoop->client = peer->sin6_addr;
|
snoop->client = peer->sin6_addr;
|
||||||
snoop->prefix_len = opt6_uint(ia_opt, 8, 1);
|
snoop->prefix_len = opt6_uint(opt, 8, 1);
|
||||||
memcpy(&snoop->prefix, opt6_ptr(ia_opt, 9), IN6ADDRSZ);
|
memcpy(&snoop->prefix, opt6_ptr(opt, 9), IN6ADDRSZ);
|
||||||
snoop->next = relay->snoop_records;
|
snoop->next = relay->snoop_records;
|
||||||
relay->snoop_records = snoop;
|
relay->snoop_records = snoop;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in new issue
Block a user