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
b269221c
Commit
b269221c
authored
Sep 16, 2012
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address allocation tweaking - lease outside dhcp-range but in subnet.
parent
8b46061e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
7 deletions
+14
-7
src/dhcp6.c
src/dhcp6.c
+12
-5
src/dnsmasq.h
src/dnsmasq.h
+1
-0
src/lease.c
src/lease.c
+1
-1
src/rfc3315.c
src/rfc3315.c
+0
-1
No files found.
src/dhcp6.c
View file @
b269221c
...
@@ -323,14 +323,21 @@ struct dhcp_context *narrow_context6(struct dhcp_context *context,
...
@@ -323,14 +323,21 @@ struct dhcp_context *narrow_context6(struct dhcp_context *context,
return
tmp
;
return
tmp
;
}
}
static
int
is_
addr
_in_context6
(
struct
dhcp_context
*
context
,
struct
dhcp_config
*
config
)
static
int
is_
config
_in_context6
(
struct
dhcp_context
*
context
,
struct
dhcp_config
*
config
)
{
{
if
(
!
context
)
/* called via find_config() from lease_update_from_configs() */
if
(
!
context
)
/* called via find_config() from lease_update_from_configs() */
return
1
;
return
1
;
if
(
!
(
config
->
flags
&
CONFIG_ADDR6
))
if
(
!
(
config
->
flags
&
CONFIG_ADDR6
)
||
is_addr_in_context6
(
context
,
&
config
->
addr6
)
)
return
1
;
return
1
;
return
0
;
}
int
is_addr_in_context6
(
struct
dhcp_context
*
context
,
struct
in6_addr
*
addr
)
{
for
(;
context
;
context
=
context
->
current
)
for
(;
context
;
context
=
context
->
current
)
if
(
is_same_net6
(
&
config
->
addr6
,
&
context
->
start6
,
context
->
prefix
))
if
(
is_same_net6
(
addr
,
&
context
->
start6
,
context
->
prefix
))
return
1
;
return
1
;
return
0
;
return
0
;
...
@@ -350,7 +357,7 @@ struct dhcp_config *find_config6(struct dhcp_config *configs,
...
@@ -350,7 +357,7 @@ struct dhcp_config *find_config6(struct dhcp_config *configs,
{
{
if
(
config
->
clid_len
==
duid_len
&&
if
(
config
->
clid_len
==
duid_len
&&
memcmp
(
config
->
clid
,
duid
,
duid_len
)
==
0
&&
memcmp
(
config
->
clid
,
duid
,
duid_len
)
==
0
&&
is_
addr
_in_context6
(
context
,
config
))
is_
config
_in_context6
(
context
,
config
))
return
config
;
return
config
;
}
}
...
@@ -358,7 +365,7 @@ struct dhcp_config *find_config6(struct dhcp_config *configs,
...
@@ -358,7 +365,7 @@ struct dhcp_config *find_config6(struct dhcp_config *configs,
for
(
config
=
configs
;
config
;
config
=
config
->
next
)
for
(
config
=
configs
;
config
;
config
=
config
->
next
)
if
((
config
->
flags
&
CONFIG_NAME
)
&&
if
((
config
->
flags
&
CONFIG_NAME
)
&&
hostname_isequal
(
config
->
hostname
,
hostname
)
&&
hostname_isequal
(
config
->
hostname
,
hostname
)
&&
is_
addr
_in_context6
(
context
,
config
))
is_
config
_in_context6
(
context
,
config
))
return
config
;
return
config
;
return
NULL
;
return
NULL
;
...
...
src/dnsmasq.h
View file @
b269221c
...
@@ -1092,6 +1092,7 @@ void dhcp6_init(void);
...
@@ -1092,6 +1092,7 @@ void dhcp6_init(void);
void
dhcp6_packet
(
time_t
now
);
void
dhcp6_packet
(
time_t
now
);
int
address6_allocate
(
struct
dhcp_context
*
context
,
unsigned
char
*
clid
,
int
clid_len
,
int
address6_allocate
(
struct
dhcp_context
*
context
,
unsigned
char
*
clid
,
int
clid_len
,
int
serial
,
struct
dhcp_netid
*
netids
,
struct
in6_addr
*
ans
);
int
serial
,
struct
dhcp_netid
*
netids
,
struct
in6_addr
*
ans
);
int
is_addr_in_context6
(
struct
dhcp_context
*
context
,
struct
in6_addr
*
addr
);
struct
dhcp_context
*
address6_available
(
struct
dhcp_context
*
context
,
struct
dhcp_context
*
address6_available
(
struct
dhcp_context
*
context
,
struct
in6_addr
*
taddr
,
struct
in6_addr
*
taddr
,
struct
dhcp_netid
*
netids
);
struct
dhcp_netid
*
netids
);
...
...
src/lease.c
View file @
b269221c
...
@@ -582,7 +582,7 @@ void lease6_filter(int lease_type, int iaid, struct dhcp_context *context)
...
@@ -582,7 +582,7 @@ void lease6_filter(int lease_type, int iaid, struct dhcp_context *context)
continue
;
continue
;
/* leases on the wrong interface get filtered out here */
/* leases on the wrong interface get filtered out here */
if
(
!
address6_available
(
context
,
(
struct
in6_addr
*
)
&
lease
->
hwaddr
,
NULL
))
if
(
!
is_addr_in_context6
(
context
,
(
struct
in6_addr
*
)
&
lease
->
hwaddr
))
lease
->
flags
|=
LEASE_USED
;
lease
->
flags
|=
LEASE_USED
;
}
}
}
}
...
...
src/rfc3315.c
View file @
b269221c
...
@@ -582,7 +582,6 @@ static int dhcp6_no_relay(int msg_type, struct in6_addr *link_address, struct dh
...
@@ -582,7 +582,6 @@ static int dhcp6_no_relay(int msg_type, struct in6_addr *link_address, struct dh
if
(
!
addrp
&&
if
(
!
addrp
&&
(
lease
=
lease6_find
(
clid
,
clid_len
,
(
lease
=
lease6_find
(
clid
,
clid_len
,
ia_type
==
OPTION6_IA_NA
?
LEASE_NA
:
LEASE_TA
,
iaid
,
NULL
))
&&
ia_type
==
OPTION6_IA_NA
?
LEASE_NA
:
LEASE_TA
,
iaid
,
NULL
))
&&
address6_available
(
context
,
(
struct
in6_addr
*
)
&
lease
->
hwaddr
,
tags
)
&&
!
config_find_by_address6
(
daemon
->
dhcp_conf
,
(
struct
in6_addr
*
)
&
lease
->
hwaddr
,
128
,
0
))
!
config_find_by_address6
(
daemon
->
dhcp_conf
,
(
struct
in6_addr
*
)
&
lease
->
hwaddr
,
128
,
0
))
addrp
=
(
struct
in6_addr
*
)
&
lease
->
hwaddr
;
addrp
=
(
struct
in6_addr
*
)
&
lease
->
hwaddr
;
...
...
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