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
47669367
Commit
47669367
authored
Dec 17, 2014
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eliminate IPv6 privacy addresses from --interface-name answers.
parent
bd9520b7
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
11 deletions
+28
-11
CHANGELOG
CHANGELOG
+5
-0
src/auth.c
src/auth.c
+4
-0
src/dnsmasq.h
src/dnsmasq.h
+1
-0
src/network.c
src/network.c
+8
-4
src/rfc1035.c
src/rfc1035.c
+10
-7
No files found.
CHANGELOG
View file @
47669367
...
@@ -15,6 +15,11 @@ version 2.73
...
@@ -15,6 +15,11 @@ version 2.73
queries were intercepted. THis appears to have been broken
queries were intercepted. THis appears to have been broken
since 2.69. Thanks to Josh Stone for finding the bug.
since 2.69. Thanks to Josh Stone for finding the bug.
Eliminate IPv6 privacy addresses and deprecated addresses from
the answers given by --interface-name. Note that reverse queries
(ie looking for names, given addresses) are not affected.
Thanks to Michael Gorbach for the suggestion.
version 2.72
version 2.72
Add ra-advrouter mode, for RFC-3775 mobile IPv6 support.
Add ra-advrouter mode, for RFC-3775 mobile IPv6 support.
...
...
src/auth.c
View file @
47669367
...
@@ -363,6 +363,10 @@ size_t answer_auth(struct dns_header *header, char *limit, size_t qlen, time_t n
...
@@ -363,6 +363,10 @@ size_t answer_auth(struct dns_header *header, char *limit, size_t qlen, time_t n
if
(((
addrlist
->
flags
&
ADDRLIST_IPV6
)
?
T_AAAA
:
T_A
)
==
qtype
&&
if
(((
addrlist
->
flags
&
ADDRLIST_IPV6
)
?
T_AAAA
:
T_A
)
==
qtype
&&
(
local_query
||
filter_zone
(
zone
,
flag
,
&
addrlist
->
addr
)))
(
local_query
||
filter_zone
(
zone
,
flag
,
&
addrlist
->
addr
)))
{
{
#ifdef HAVE_IPV6
if
(
addrlist
->
flags
&
ADDRLIST_REVONLY
)
continue
;
#endif
found
=
1
;
found
=
1
;
log_query
(
F_FORWARD
|
F_CONFIG
|
flag
,
name
,
&
addrlist
->
addr
,
NULL
);
log_query
(
F_FORWARD
|
F_CONFIG
|
flag
,
name
,
&
addrlist
->
addr
,
NULL
);
if
(
add_resource_record
(
header
,
limit
,
&
trunc
,
nameoffset
,
&
ansp
,
if
(
add_resource_record
(
header
,
limit
,
&
trunc
,
nameoffset
,
&
ansp
,
...
...
src/dnsmasq.h
View file @
47669367
...
@@ -318,6 +318,7 @@ struct ds_config {
...
@@ -318,6 +318,7 @@ struct ds_config {
#define ADDRLIST_LITERAL 1
#define ADDRLIST_LITERAL 1
#define ADDRLIST_IPV6 2
#define ADDRLIST_IPV6 2
#define ADDRLIST_REVONLY 4
struct
addrlist
{
struct
addrlist
{
struct
all_addr
addr
;
struct
all_addr
addr
;
...
...
src/network.c
View file @
47669367
...
@@ -236,7 +236,7 @@ struct iface_param {
...
@@ -236,7 +236,7 @@ struct iface_param {
};
};
static
int
iface_allowed
(
struct
iface_param
*
param
,
int
if_index
,
char
*
label
,
static
int
iface_allowed
(
struct
iface_param
*
param
,
int
if_index
,
char
*
label
,
union
mysockaddr
*
addr
,
struct
in_addr
netmask
,
int
prefixlen
,
int
dad
)
union
mysockaddr
*
addr
,
struct
in_addr
netmask
,
int
prefixlen
,
int
iface_flags
)
{
{
struct
irec
*
iface
;
struct
irec
*
iface
;
int
mtu
=
0
,
loopback
;
int
mtu
=
0
,
loopback
;
...
@@ -388,6 +388,10 @@ static int iface_allowed(struct iface_param *param, int if_index, char *label,
...
@@ -388,6 +388,10 @@ static int iface_allowed(struct iface_param *param, int if_index, char *label,
{
{
al
->
addr
.
addr
.
addr6
=
addr
->
in6
.
sin6_addr
;
al
->
addr
.
addr
.
addr6
=
addr
->
in6
.
sin6_addr
;
al
->
flags
=
ADDRLIST_IPV6
;
al
->
flags
=
ADDRLIST_IPV6
;
/* Privacy addresses and addresses still undergoing DAD and deprecated addresses
don't appear in forward queries, but will in reverse ones. */
if
(
!
(
iface_flags
&
IFACE_PERMANENT
)
||
(
iface_flags
&
(
IFACE_DEPRECATED
|
IFACE_TENTATIVE
)))
al
->
flags
|=
ADDRLIST_REVONLY
;
}
}
#endif
#endif
}
}
...
@@ -399,7 +403,7 @@ static int iface_allowed(struct iface_param *param, int if_index, char *label,
...
@@ -399,7 +403,7 @@ static int iface_allowed(struct iface_param *param, int if_index, char *label,
for
(
iface
=
daemon
->
interfaces
;
iface
;
iface
=
iface
->
next
)
for
(
iface
=
daemon
->
interfaces
;
iface
;
iface
=
iface
->
next
)
if
(
sockaddr_isequal
(
&
iface
->
addr
,
addr
))
if
(
sockaddr_isequal
(
&
iface
->
addr
,
addr
))
{
{
iface
->
dad
=
dad
;
iface
->
dad
=
!!
(
iface_flags
&
IFACE_TENTATIVE
)
;
iface
->
found
=
1
;
/* for garbage collection */
iface
->
found
=
1
;
/* for garbage collection */
return
1
;
return
1
;
}
}
...
@@ -474,7 +478,7 @@ static int iface_allowed(struct iface_param *param, int if_index, char *label,
...
@@ -474,7 +478,7 @@ static int iface_allowed(struct iface_param *param, int if_index, char *label,
iface
->
dhcp_ok
=
dhcp_ok
;
iface
->
dhcp_ok
=
dhcp_ok
;
iface
->
dns_auth
=
auth_dns
;
iface
->
dns_auth
=
auth_dns
;
iface
->
mtu
=
mtu
;
iface
->
mtu
=
mtu
;
iface
->
dad
=
dad
;
iface
->
dad
=
!!
(
iface_flags
&
IFACE_TENTATIVE
)
;
iface
->
found
=
1
;
iface
->
found
=
1
;
iface
->
done
=
iface
->
multicast_done
=
iface
->
warned
=
0
;
iface
->
done
=
iface
->
multicast_done
=
iface
->
warned
=
0
;
iface
->
index
=
if_index
;
iface
->
index
=
if_index
;
...
@@ -519,7 +523,7 @@ static int iface_allowed_v6(struct in6_addr *local, int prefix,
...
@@ -519,7 +523,7 @@ static int iface_allowed_v6(struct in6_addr *local, int prefix,
else
else
addr
.
in6
.
sin6_scope_id
=
0
;
addr
.
in6
.
sin6_scope_id
=
0
;
return
iface_allowed
((
struct
iface_param
*
)
vparam
,
if_index
,
NULL
,
&
addr
,
netmask
,
prefix
,
!!
(
flags
&
IFACE_TENTATIVE
)
);
return
iface_allowed
((
struct
iface_param
*
)
vparam
,
if_index
,
NULL
,
&
addr
,
netmask
,
prefix
,
flags
);
}
}
#endif
#endif
...
...
src/rfc1035.c
View file @
47669367
...
@@ -1923,15 +1923,18 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
...
@@ -1923,15 +1923,18 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
for
(
intr
=
daemon
->
int_names
;
intr
;
intr
=
intr
->
next
)
for
(
intr
=
daemon
->
int_names
;
intr
;
intr
=
intr
->
next
)
if
(
hostname_isequal
(
name
,
intr
->
name
))
if
(
hostname_isequal
(
name
,
intr
->
name
))
{
{
ans
=
1
;
if
(
!
dryrun
)
{
for
(
addrlist
=
intr
->
addr
;
addrlist
;
addrlist
=
addrlist
->
next
)
for
(
addrlist
=
intr
->
addr
;
addrlist
;
addrlist
=
addrlist
->
next
)
#ifdef HAVE_IPV6
#ifdef HAVE_IPV6
if
(((
addrlist
->
flags
&
ADDRLIST_IPV6
)
?
T_AAAA
:
T_A
)
==
type
)
if
(((
addrlist
->
flags
&
ADDRLIST_IPV6
)
?
T_AAAA
:
T_A
)
==
type
)
#endif
#endif
{
{
#ifdef HAVE_IPV6
if
(
addrlist
->
flags
&
ADDRLIST_REVONLY
)
continue
;
#endif
ans
=
1
;
if
(
!
dryrun
)
{
gotit
=
1
;
gotit
=
1
;
log_query
(
F_FORWARD
|
F_CONFIG
|
flag
,
name
,
&
addrlist
->
addr
,
NULL
);
log_query
(
F_FORWARD
|
F_CONFIG
|
flag
,
name
,
&
addrlist
->
addr
,
NULL
);
if
(
add_resource_record
(
header
,
limit
,
&
trunc
,
nameoffset
,
&
ansp
,
if
(
add_resource_record
(
header
,
limit
,
&
trunc
,
nameoffset
,
&
ansp
,
...
...
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