Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
Dnsmasq
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Dnsmasq
Commits
c50f25a3
Commit
c50f25a3
authored
Nov 21, 2013
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow empty subnet list in --auth-zone
parent
f25e6c6d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
man/dnsmasq.8
man/dnsmasq.8
+6
-3
src/auth.c
src/auth.c
+11
-2
No files found.
man/dnsmasq.8
View file @
c50f25a3
...
@@ -593,8 +593,10 @@ needed for a client to do validation itself.
...
@@ -593,8 +593,10 @@ needed for a client to do validation itself.
.TP
.TP
.B --auth-zone=<domain>[,<subnet>[/<prefix length>][,<subnet>[/<prefix length>].....]]
.B --auth-zone=<domain>[,<subnet>[/<prefix length>][,<subnet>[/<prefix length>].....]]
Define a DNS zone for which dnsmasq acts as authoritative server. Locally defined DNS records which are in the domain
Define a DNS zone for which dnsmasq acts as authoritative server. Locally defined DNS records which are in the domain
will be served. A and AAAA records must be in one of the
will be served. If subnet(s) are given, A and AAAA records must be in one of the
specified subnets. As alternative to directly specifying the subnets, it's possible to
specified subnets.
As alternative to directly specifying the subnets, it's possible to
give the name of an interface, in which case the subnets implied by
give the name of an interface, in which case the subnets implied by
that interface's configured addresses and netmask/prefix-length are
that interface's configured addresses and netmask/prefix-length are
used; this is useful when using constructed DHCP ranges as the actual
used; this is useful when using constructed DHCP ranges as the actual
...
@@ -611,7 +613,8 @@ ipv6.arpa domains which are served for reverse-DNS queries. If not
...
@@ -611,7 +613,8 @@ ipv6.arpa domains which are served for reverse-DNS queries. If not
specified, the prefix length defaults to 24 for IPv4 and 64 for IPv6.
specified, the prefix length defaults to 24 for IPv4 and 64 for IPv6.
For IPv4 subnets, the prefix length should be have the value 8, 16 or 24
For IPv4 subnets, the prefix length should be have the value 8, 16 or 24
unless you are familiar with RFC 2317 and have arranged the
unless you are familiar with RFC 2317 and have arranged the
in-addr.arpa delegation accordingly.
in-addr.arpa delegation accordingly. Note that if no subnets are
specified, then no reverse queries are answered.
.TP
.TP
.B --auth-soa=<serial>[,<hostmaster>[,<refresh>[,<retry>[,<expiry>]]]]
.B --auth-soa=<serial>[,<hostmaster>[,<refresh>[,<retry>[,<expiry>]]]]
Specify fields in the SOA record associated with authoritative
Specify fields in the SOA record associated with authoritative
...
...
src/auth.c
View file @
c50f25a3
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
#ifdef HAVE_AUTH
#ifdef HAVE_AUTH
static
struct
addrlist
*
fi
lter_zone
(
struct
auth_zone
*
zone
,
int
flag
,
struct
all_addr
*
addr_u
)
static
struct
addrlist
*
fi
nd_subnet
(
struct
auth_zone
*
zone
,
int
flag
,
struct
all_addr
*
addr_u
)
{
{
struct
addrlist
*
subnet
;
struct
addrlist
*
subnet
;
...
@@ -45,6 +45,15 @@ static struct addrlist *filter_zone(struct auth_zone *zone, int flag, struct all
...
@@ -45,6 +45,15 @@ static struct addrlist *filter_zone(struct auth_zone *zone, int flag, struct all
return
NULL
;
return
NULL
;
}
}
static
int
filter_zone
(
struct
auth_zone
*
zone
,
int
flag
,
struct
all_addr
*
addr_u
)
{
/* No zones specified, no filter */
if
(
!
zone
->
subnet
)
return
1
;
return
find_subnet
(
zone
,
flag
,
addr_u
)
!=
NULL
;
}
int
in_zone
(
struct
auth_zone
*
zone
,
char
*
name
,
char
**
cut
)
int
in_zone
(
struct
auth_zone
*
zone
,
char
*
name
,
char
**
cut
)
{
{
size_t
namelen
=
strlen
(
name
);
size_t
namelen
=
strlen
(
name
);
...
@@ -130,7 +139,7 @@ size_t answer_auth(struct dns_header *header, char *limit, size_t qlen, time_t n
...
@@ -130,7 +139,7 @@ size_t answer_auth(struct dns_header *header, char *limit, size_t qlen, time_t n
if
(
!
local_query
)
if
(
!
local_query
)
{
{
for
(
zone
=
daemon
->
auth_zones
;
zone
;
zone
=
zone
->
next
)
for
(
zone
=
daemon
->
auth_zones
;
zone
;
zone
=
zone
->
next
)
if
((
subnet
=
fi
lter_zone
(
zone
,
flag
,
&
addr
)))
if
((
subnet
=
fi
nd_subnet
(
zone
,
flag
,
&
addr
)))
break
;
break
;
if
(
!
zone
)
if
(
!
zone
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment