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
7480aeff
Commit
7480aeff
authored
Feb 26, 2016
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply ceiling of lease length to TTL when --dhcp-ttl in use.
parent
bec366b4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
src/rfc1035.c
src/rfc1035.c
+10
-2
No files found.
src/rfc1035.c
View file @
7480aeff
...
...
@@ -1167,10 +1167,18 @@ int add_resource_record(struct dns_header *header, char *limit, int *truncp, int
static
unsigned
long
crec_ttl
(
struct
crec
*
crecp
,
time_t
now
)
{
/* Return 0 ttl for DHCP entries, which might change
before the lease expires. */
before the lease expires
, unless configured otherwise
. */
if
(
crecp
->
flags
&
F_DHCP
)
return
daemon
->
use_dhcp_ttl
?
daemon
->
dhcp_ttl
:
daemon
->
local_ttl
;
{
int
conf_ttl
=
daemon
->
use_dhcp_ttl
?
daemon
->
dhcp_ttl
:
daemon
->
local_ttl
;
/* Apply ceiling of actual lease length to configured TTL. */
if
(
!
(
crecp
->
flags
&
F_IMMORTAL
)
&&
(
crecp
->
ttd
-
now
)
<
conf_ttl
)
return
crecp
->
ttd
-
now
;
return
conf_ttl
;
}
/* Immortal entries other than DHCP are local, and hold TTL in TTD field. */
if
(
crecp
->
flags
&
F_IMMORTAL
)
...
...
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