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
de92b479
Commit
de92b479
authored
Mar 15, 2013
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make wildcard-configured addresses work on multiple networks.
parent
0f128eb5
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
161 additions
and
116 deletions
+161
-116
src/dhcp6.c
src/dhcp6.c
+21
-14
src/dnsmasq.h
src/dnsmasq.h
+2
-1
src/rfc3315.c
src/rfc3315.c
+138
-101
No files found.
src/dhcp6.c
View file @
de92b479
...
...
@@ -371,31 +371,38 @@ struct dhcp_context *address6_valid(struct dhcp_context *context,
return
NULL
;
}
static
int
is_config_in_context6
(
struct
dhcp_context
*
context
,
struct
dhcp_config
*
config
)
int
config_valid
(
struct
dhcp_config
*
config
,
struct
dhcp_context
*
context
,
struct
in6_addr
*
addr
)
{
/* expand wildcard on contructed contexts */
if
((
config
->
flags
&
CONFIG_WILDCARD
)
&&
(
context
->
flags
&
CONTEXT_CONSTRUCTED
))
if
(
!
config
||
!
(
config
->
flags
&
CONFIG_ADDR6
))
return
0
;
if
((
config
->
flags
&
CONFIG_WILDCARD
)
&&
context
->
prefix
==
64
)
{
u64
addrpart
=
addr6part
(
&
config
->
addr6
);
config
->
addr6
=
context
->
start6
;
setaddr6part
(
&
config
->
addr6
,
addrpart
);
*
addr
=
context
->
start6
;
setaddr6part
(
addr
,
addr6part
(
&
config
->
addr6
));
return
1
;
}
if
(
is_same_net6
(
&
context
->
start6
,
&
config
->
addr6
,
context
->
prefix
))
{
*
addr
=
config
->
addr6
;
return
1
;
}
if
(
!
(
config
->
flags
&
CONFIG_ADDR6
)
||
is_addr_in_context6
(
context
,
&
config
->
addr6
))
return
1
;
return
0
;
}
int
is_addr_in_context6
(
struct
dhcp_context
*
context
,
struct
in6_addr
*
addr
)
static
int
is_config_in_context6
(
struct
dhcp_context
*
context
,
struct
dhcp_config
*
config
)
{
if
(
!
(
config
->
flags
&
CONFIG_ADDR6
)
||
(
config
->
flags
&
CONFIG_WILDCARD
))
return
1
;
for
(;
context
;
context
=
context
->
current
)
if
(
is_same_net6
(
addr
,
&
context
->
start6
,
context
->
prefix
))
if
(
is_same_net6
(
&
config
->
addr6
,
&
context
->
start6
,
context
->
prefix
))
return
1
;
return
0
;
}
...
...
src/dnsmasq.h
View file @
de92b479
...
...
@@ -723,6 +723,7 @@ struct dhcp_context {
#define CONTEXT_RA 8192
#define CONTEXT_WILDCARD 16384
#define CONTEXT_USED 32768
#define CONTEXT_CONF_USED 65536
struct
ping_result
{
struct
in_addr
addr
;
...
...
@@ -1175,7 +1176,7 @@ void dhcp6_init(void);
void
dhcp6_packet
(
time_t
now
);
struct
dhcp_context
*
address6_allocate
(
struct
dhcp_context
*
context
,
unsigned
char
*
clid
,
int
clid_len
,
int
iaid
,
int
serial
,
struct
dhcp_netid
*
netids
,
int
plain_range
,
struct
in6_addr
*
ans
);
int
is_addr_in_context6
(
struct
dhcp_context
*
context
,
struct
in6_addr
*
addr
);
int
config_valid
(
struct
dhcp_config
*
config
,
struct
dhcp_context
*
context
,
struct
in6_addr
*
addr
);
struct
dhcp_context
*
address6_available
(
struct
dhcp_context
*
context
,
struct
in6_addr
*
taddr
,
struct
dhcp_netid
*
netids
,
...
...
src/rfc3315.c
View file @
de92b479
This diff is collapsed.
Click to expand it.
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