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
1d860415
Commit
1d860415
authored
Sep 20, 2012
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add --max-cache-ttl option.
parent
289a2535
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
1 deletion
+15
-1
CHANGELOG
CHANGELOG
+3
-0
man/dnsmasq.8
man/dnsmasq.8
+3
-0
src/cache.c
src/cache.c
+3
-0
src/dnsmasq.h
src/dnsmasq.h
+1
-1
src/option.c
src/option.c
+5
-0
No files found.
CHANGELOG
View file @
1d860415
...
@@ -25,6 +25,9 @@ version 2.64
...
@@ -25,6 +25,9 @@ version 2.64
Fix build with later Lua libraries. Thansk to Cristian
Fix build with later Lua libraries. Thansk to Cristian
Rodriguez for the patch.
Rodriguez for the patch.
Add --max-cache-ttl option. Thanks to Dennis Kaarsemaker
for the patch.
version 2.63
version 2.63
Do duplicate dhcp-host address check in --test mode.
Do duplicate dhcp-host address check in --test mode.
...
...
man/dnsmasq.8
View file @
1d860415
...
@@ -71,6 +71,9 @@ maximum TTL will be given to clients instead of the true TTL value if it is
...
@@ -71,6 +71,9 @@ maximum TTL will be given to clients instead of the true TTL value if it is
lower. The true TTL value is however kept in the cache to avoid flooding
lower. The true TTL value is however kept in the cache to avoid flooding
the upstream DNS servers.
the upstream DNS servers.
.TP
.TP
.B --max-cache-ttl=<time>
Set a maximum TTL value for entries in the cache.
.TP
.B \-k, --keep-in-foreground
.B \-k, --keep-in-foreground
Do not go into the background at startup but otherwise run as
Do not go into the background at startup but otherwise run as
normal. This is intended for use when dnsmasq is run under daemontools
normal. This is intended for use when dnsmasq is run under daemontools
...
...
src/cache.c
View file @
1d860415
...
@@ -371,6 +371,9 @@ struct crec *cache_insert(char *name, struct all_addr *addr,
...
@@ -371,6 +371,9 @@ struct crec *cache_insert(char *name, struct all_addr *addr,
int
freed_all
=
flags
&
F_REVERSE
;
int
freed_all
=
flags
&
F_REVERSE
;
int
free_avail
=
0
;
int
free_avail
=
0
;
if
(
daemon
->
max_cache_ttl
<
ttl
)
ttl
=
daemon
->
max_cache_ttl
;
/* Don't log keys */
/* Don't log keys */
if
(
flags
&
(
F_IPV4
|
F_IPV6
))
if
(
flags
&
(
F_IPV4
|
F_IPV6
))
log_query
(
flags
|
F_UPSTREAM
,
name
,
addr
,
NULL
);
log_query
(
flags
|
F_UPSTREAM
,
name
,
addr
,
NULL
);
...
...
src/dnsmasq.h
View file @
1d860415
...
@@ -751,7 +751,7 @@ extern struct daemon {
...
@@ -751,7 +751,7 @@ extern struct daemon {
int
max_logs
;
/* queue limit */
int
max_logs
;
/* queue limit */
int
cachesize
,
ftabsize
;
int
cachesize
,
ftabsize
;
int
port
,
query_port
,
min_port
;
int
port
,
query_port
,
min_port
;
unsigned
long
local_ttl
,
neg_ttl
,
max_ttl
;
unsigned
long
local_ttl
,
neg_ttl
,
max_ttl
,
max_cache_ttl
;
struct
hostsfile
*
addn_hosts
;
struct
hostsfile
*
addn_hosts
;
struct
dhcp_context
*
dhcp
,
*
dhcp6
,
*
ra_contexts
;
struct
dhcp_context
*
dhcp
,
*
dhcp6
,
*
ra_contexts
;
struct
dhcp_config
*
dhcp_conf
;
struct
dhcp_config
*
dhcp_conf
;
...
...
src/option.c
View file @
1d860415
...
@@ -120,6 +120,7 @@ struct myoption {
...
@@ -120,6 +120,7 @@ struct myoption {
#define LOPT_TFTP_LC 309
#define LOPT_TFTP_LC 309
#define LOPT_RR 310
#define LOPT_RR 310
#define LOPT_CLVERBIND 311
#define LOPT_CLVERBIND 311
#define LOPT_MAXCTTL 312
#ifdef HAVE_GETOPT_LONG
#ifdef HAVE_GETOPT_LONG
static
const
struct
option
opts
[]
=
static
const
struct
option
opts
[]
=
...
@@ -223,6 +224,7 @@ static const struct myoption opts[] =
...
@@ -223,6 +224,7 @@ static const struct myoption opts[] =
{
"dhcp-broadcast"
,
2
,
0
,
LOPT_BROADCAST
},
{
"dhcp-broadcast"
,
2
,
0
,
LOPT_BROADCAST
},
{
"neg-ttl"
,
1
,
0
,
LOPT_NEGTTL
},
{
"neg-ttl"
,
1
,
0
,
LOPT_NEGTTL
},
{
"max-ttl"
,
1
,
0
,
LOPT_MAXTTL
},
{
"max-ttl"
,
1
,
0
,
LOPT_MAXTTL
},
{
"max-cache-ttl"
,
1
,
0
,
LOPT_MAXCTTL
},
{
"dhcp-alternate-port"
,
2
,
0
,
LOPT_ALTPORT
},
{
"dhcp-alternate-port"
,
2
,
0
,
LOPT_ALTPORT
},
{
"dhcp-scriptuser"
,
1
,
0
,
LOPT_SCRIPTUSR
},
{
"dhcp-scriptuser"
,
1
,
0
,
LOPT_SCRIPTUSR
},
{
"min-port"
,
1
,
0
,
LOPT_MINPORT
},
{
"min-port"
,
1
,
0
,
LOPT_MINPORT
},
...
@@ -1930,6 +1932,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
...
@@ -1930,6 +1932,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
case
'T'
:
/* --local-ttl */
case
'T'
:
/* --local-ttl */
case
LOPT_NEGTTL
:
/* --neg-ttl */
case
LOPT_NEGTTL
:
/* --neg-ttl */
case
LOPT_MAXTTL
:
/* --max-ttl */
case
LOPT_MAXTTL
:
/* --max-ttl */
case
LOPT_MAXCTTL
:
/* --max-cache-ttl */
{
{
int
ttl
;
int
ttl
;
if
(
!
atoi_check
(
arg
,
&
ttl
))
if
(
!
atoi_check
(
arg
,
&
ttl
))
...
@@ -1938,6 +1941,8 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
...
@@ -1938,6 +1941,8 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
daemon
->
neg_ttl
=
(
unsigned
long
)
ttl
;
daemon
->
neg_ttl
=
(
unsigned
long
)
ttl
;
else
if
(
option
==
LOPT_MAXTTL
)
else
if
(
option
==
LOPT_MAXTTL
)
daemon
->
max_ttl
=
(
unsigned
long
)
ttl
;
daemon
->
max_ttl
=
(
unsigned
long
)
ttl
;
else
if
(
option
==
LOPT_MAXCTTL
)
daemon
->
max_cache_ttl
=
(
unsigned
long
)
ttl
;
else
else
daemon
->
local_ttl
=
(
unsigned
long
)
ttl
;
daemon
->
local_ttl
=
(
unsigned
long
)
ttl
;
break
;
break
;
...
...
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