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
903df07b
Commit
903df07b
authored
Jan 19, 2017
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Detect and error loops in --cname configuration.
parent
0ef1334d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
5 deletions
+42
-5
CHANGELOG
CHANGELOG
+4
-0
src/dnsmasq.h
src/dnsmasq.h
+2
-2
src/option.c
src/option.c
+36
-3
No files found.
CHANGELOG
View file @
903df07b
version 2.77
Generate an error when configured with a CNAME loop,
rather than a crash. Thnaks to George Metz for
spotting this problem.
Calculate the length of TFTP error reply packet
correctly. This fixes a problem when the error
message in a TFTP packet exceeds the arbitrary
...
...
src/dnsmasq.h
View file @
903df07b
...
...
@@ -310,9 +310,9 @@ struct ptr_record {
};
struct
cname
{
int
ttl
;
int
ttl
,
flag
;
char
*
alias
,
*
target
;
struct
cname
*
next
;
struct
cname
*
next
,
*
targetp
;
};
struct
ds_config
{
...
...
src/option.c
View file @
903df07b
...
...
@@ -4663,11 +4663,44 @@ void read_opts(int argc, char **argv, char *compile_opts)
if
(
daemon
->
cnames
)
{
struct
cname
*
cn
;
struct
cname
*
cn
,
*
cn2
,
*
cn3
;
#define NOLOOP 1
#define TESTLOOP 2
/* Fill in TTL for CNAMES noe we have local_ttl.
Also prepare to do loop detection. */
for
(
cn
=
daemon
->
cnames
;
cn
;
cn
=
cn
->
next
)
{
if
(
cn
->
ttl
==
-
1
)
cn
->
ttl
=
daemon
->
local_ttl
;
cn
->
flag
=
0
;
cn
->
targetp
=
NULL
;
for
(
cn2
=
daemon
->
cnames
;
cn2
;
cn2
=
cn2
->
next
)
if
(
hostname_isequal
(
cn
->
target
,
cn2
->
alias
))
{
cn
->
targetp
=
cn2
;
break
;
}
}
/* Find any CNAME loops.*/
for
(
cn
=
daemon
->
cnames
;
cn
;
cn
=
cn
->
next
)
if
(
cn
->
ttl
==
-
1
)
cn
->
ttl
=
daemon
->
local_ttl
;
{
for
(
cn2
=
cn
->
targetp
;
cn2
;
cn2
=
cn2
->
targetp
)
{
if
(
cn2
->
flag
==
NOLOOP
)
break
;
if
(
cn2
->
flag
==
TESTLOOP
)
die
(
_
(
"CNAME loop involving %s"
),
cn
->
alias
,
EC_BADCONF
);
cn2
->
flag
=
TESTLOOP
;
}
for
(
cn3
=
cn
->
targetp
;
cn3
!=
cn2
;
cn3
=
cn3
->
targetp
)
cn3
->
flag
=
NOLOOP
;
}
}
if
(
daemon
->
if_addrs
)
...
...
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