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
6d8e8ac0
Commit
6d8e8ac0
authored
Jul 13, 2014
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tidy up previous commit.
parent
24b167ad
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
23 deletions
+27
-23
CHANGELOG
CHANGELOG
+6
-0
src/dnsmasq.h
src/dnsmasq.h
+0
-1
src/lease.c
src/lease.c
+15
-17
src/util.c
src/util.c
+6
-5
No files found.
CHANGELOG
View file @
6d8e8ac0
...
...
@@ -14,6 +14,12 @@ version 2.72
Fix failure to build against Nettle-3.0. Thanks to Steven
Barth for spotting this and finding the fix.
When assigning existing DHCP leases to intefaces by comparing
networks, handle the case that two or more interfaces have the
same network part, but different prefix lengths (favour the
longer prefix length.) Thanks to Lung-Pin Chang for the
patch.
version 2.71
Subtle change to error handling to help DNSSEC validation
...
...
src/dnsmasq.h
View file @
6d8e8ac0
...
...
@@ -1247,7 +1247,6 @@ char *host_from_dns(struct in_addr addr);
#ifdef HAVE_DHCP
void
lease_update_file
(
time_t
now
);
void
lease_update_dns
(
int
force
);
void
lease_update_interface
(
time_t
now
);
void
lease_init
(
time_t
now
);
struct
dhcp_lease
*
lease4_allocate
(
struct
in_addr
addr
);
#ifdef HAVE_DHCP6
...
...
src/lease.c
View file @
6d8e8ac0
...
...
@@ -352,20 +352,20 @@ static int find_interface_v4(struct in_addr local, int if_index, char *label,
struct
in_addr
netmask
,
struct
in_addr
broadcast
,
void
*
vparam
)
{
struct
dhcp_lease
*
lease
;
int
prefix
;
int
prefix
=
netmask_length
(
netmask
)
;
(
void
)
label
;
(
void
)
broadcast
;
(
void
)
vparam
;
for
(
lease
=
leases
;
lease
;
lease
=
lease
->
next
)
if
(
!
(
lease
->
flags
&
(
LEASE_TA
|
LEASE_NA
)))
{
prefix
=
netmask_length
(
netmask
);
if
(
is_same_net
(
local
,
lease
->
addr
,
netmask
)
&&
prefix
>
lease
->
new_prefixlen
)
{
lease
->
new_interface
=
if_index
;
if
(
!
(
lease
->
flags
&
(
LEASE_TA
|
LEASE_NA
))
&&
is_same_net
(
local
,
lease
->
addr
,
netmask
)
&&
prefix
>
lease
->
new_prefixlen
)
{
lease
->
new_interface
=
if_index
;
lease
->
new_prefixlen
=
prefix
;
}
}
return
1
;
}
...
...
@@ -425,11 +425,19 @@ void lease_update_slaac(time_t now)
start-time. */
void
lease_find_interfaces
(
time_t
now
)
{
struct
dhcp_lease
*
lease
;
for
(
lease
=
leases
;
lease
;
lease
=
lease
->
next
)
lease
->
new_prefixlen
=
lease
->
new_interface
=
0
;
iface_enumerate
(
AF_INET
,
&
now
,
find_interface_v4
);
#ifdef HAVE_DHCP6
iface_enumerate
(
AF_INET6
,
&
now
,
find_interface_v6
);
#endif
lease_update_interface
(
now
);
for
(
lease
=
leases
;
lease
;
lease
=
lease
->
next
)
if
(
lease
->
new_interface
!=
0
)
lease_set_interface
(
lease
,
lease
->
new_interface
,
now
);
}
#ifdef HAVE_DHCP6
...
...
@@ -504,16 +512,6 @@ void lease_update_dns(int force)
}
}
void
lease_update_interface
(
time_t
now
)
{
struct
dhcp_lease
*
lease
;
for
(
lease
=
leases
;
lease
;
lease
=
lease
->
next
)
if
(
lease
->
new_interface
>
0
)
{
lease_set_interface
(
lease
,
lease
->
new_interface
,
now
);
}
}
void
lease_prune
(
struct
dhcp_lease
*
target
,
time_t
now
)
{
struct
dhcp_lease
*
lease
,
*
tmp
,
**
up
;
...
...
src/util.c
View file @
6d8e8ac0
...
...
@@ -323,11 +323,12 @@ int netmask_length(struct in_addr mask)
{
int
zero_count
=
0
;
while
(
0x0
==
(
mask
.
s_addr
&
0x1
))
{
mask
.
s_addr
>>=
1
;
++
zero_count
;
}
while
(
0x0
==
(
mask
.
s_addr
&
0x1
)
&&
zero_count
<
32
)
{
mask
.
s_addr
>>=
1
;
zero_count
++
;
}
return
32
-
zero_count
;
}
...
...
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