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
6d95099c
Commit
6d95099c
authored
Aug 11, 2016
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle v4-mapped IPv6 addresses sanely for --synth-domain.
parent
c8328ecd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
11 deletions
+32
-11
CHANGELOG
CHANGELOG
+6
-1
man/dnsmasq.8
man/dnsmasq.8
+2
-0
src/domain.c
src/domain.c
+24
-10
No files found.
CHANGELOG
View file @
6d95099c
...
@@ -24,7 +24,12 @@ version 2.77
...
@@ -24,7 +24,12 @@ version 2.77
Bump zone serial on reloading /etc/hosts and friends
Bump zone serial on reloading /etc/hosts and friends
when providing authoritative DNS. Thanks to Harrald
when providing authoritative DNS. Thanks to Harrald
Dunkel for spotting this.
Dunkel for spotting this.
Handle v4-mapped IPv6 addresses sanely in --synth-domain.
These have standard representation like ::ffff:1.2.3.4
and are now converted to names like
<prefix>--ffff-1-2-3-4.<domain>
version 2.76
version 2.76
Include 0.0.0.0/8 in DNS rebind checks. This range
Include 0.0.0.0/8 in DNS rebind checks. This range
...
...
man/dnsmasq.8
View file @
6d95099c
...
@@ -619,6 +619,8 @@ but IPv6 addresses may start with '::'
...
@@ -619,6 +619,8 @@ but IPv6 addresses may start with '::'
but DNS labels may not start with '-' so in this case if no prefix is
but DNS labels may not start with '-' so in this case if no prefix is
configured a zero is added in front of the label. ::1 becomes 0--1.
configured a zero is added in front of the label. ::1 becomes 0--1.
V4 mapped IPv6 addresses, which have a representation like ::ffff:1.2.3.4 are handled specially, and become like 0--ffff-1-2-3-4
The address range can be of the form
The address range can be of the form
<ip address>,<ip address> or <ip address>/<netmask>
<ip address>,<ip address> or <ip address>/<netmask>
.TP
.TP
...
...
src/domain.c
View file @
6d95099c
...
@@ -77,18 +77,31 @@ int is_name_synthetic(int flags, char *name, struct all_addr *addr)
...
@@ -77,18 +77,31 @@ int is_name_synthetic(int flags, char *name, struct all_addr *addr)
*
p
=
0
;
*
p
=
0
;
/* swap . or : for - */
#ifdef HAVE_IPV6
for
(
p
=
tail
;
*
p
;
p
++
)
if
(
prot
==
AF_INET6
&&
strstr
(
tail
,
"--ffff-"
)
==
tail
)
if
(
*
p
==
'-'
)
{
{
/* special hack for v4-mapped. */
if
(
prot
==
AF_INET
)
memcpy
(
tail
,
"::ffff:"
,
7
);
for
(
p
=
tail
+
7
;
*
p
;
p
++
)
if
(
*
p
==
'-'
)
*
p
=
'.'
;
*
p
=
'.'
;
}
else
#endif
{
/* swap . or : for - */
for
(
p
=
tail
;
*
p
;
p
++
)
if
(
*
p
==
'-'
)
{
if
(
prot
==
AF_INET
)
*
p
=
'.'
;
#ifdef HAVE_IPV6
#ifdef HAVE_IPV6
else
else
*
p
=
':'
;
*
p
=
':'
;
#endif
#endif
}
}
}
if
(
hostname_isequal
(
c
->
domain
,
p
+
1
)
&&
inet_pton
(
prot
,
tail
,
addr
))
if
(
hostname_isequal
(
c
->
domain
,
p
+
1
)
&&
inet_pton
(
prot
,
tail
,
addr
))
{
{
if
(
prot
==
AF_INET
)
if
(
prot
==
AF_INET
)
...
@@ -169,8 +182,9 @@ int is_rev_synth(int flag, struct all_addr *addr, char *name)
...
@@ -169,8 +182,9 @@ int is_rev_synth(int flag, struct all_addr *addr, char *name)
inet_ntop
(
AF_INET6
,
&
addr
->
addr
.
addr6
,
name
+
1
,
ADDRSTRLEN
);
inet_ntop
(
AF_INET6
,
&
addr
->
addr
.
addr6
,
name
+
1
,
ADDRSTRLEN
);
}
}
/* V4-mapped have periods.... */
for
(
p
=
name
;
*
p
;
p
++
)
for
(
p
=
name
;
*
p
;
p
++
)
if
(
*
p
==
':'
)
if
(
*
p
==
':'
||
*
p
==
'.'
)
*
p
=
'-'
;
*
p
=
'-'
;
strncat
(
name
,
"."
,
MAXDNAME
);
strncat
(
name
,
"."
,
MAXDNAME
);
...
...
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