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
2fd5bc95
Commit
2fd5bc95
authored
Jun 10, 2015
by
Neil Jerram
Committed by
Simon Kelley
Jun 10, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow router advertisements to have the "off-link" bit set.
parent
0ddb8769
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
4 deletions
+12
-4
src/dnsmasq.h
src/dnsmasq.h
+1
-0
src/option.c
src/option.c
+2
-0
src/radv.c
src/radv.c
+9
-4
No files found.
src/dnsmasq.h
View file @
2fd5bc95
...
@@ -868,6 +868,7 @@ struct dhcp_context {
...
@@ -868,6 +868,7 @@ struct dhcp_context {
#define CONTEXT_USED (1u<<15)
#define CONTEXT_USED (1u<<15)
#define CONTEXT_OLD (1u<<16)
#define CONTEXT_OLD (1u<<16)
#define CONTEXT_V6 (1u<<17)
#define CONTEXT_V6 (1u<<17)
#define CONTEXT_RA_OFF_LINK (1u<<18)
struct
ping_result
{
struct
ping_result
{
struct
in_addr
addr
;
struct
in_addr
addr
;
...
...
src/option.c
View file @
2fd5bc95
...
@@ -2699,6 +2699,8 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
...
@@ -2699,6 +2699,8 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
new
->
flags
|=
CONTEXT_RA_ROUTER
|
CONTEXT_RA
;
new
->
flags
|=
CONTEXT_RA_ROUTER
|
CONTEXT_RA
;
else
if
(
strcmp
(
a
[
leasepos
],
"ra-stateless"
)
==
0
)
else
if
(
strcmp
(
a
[
leasepos
],
"ra-stateless"
)
==
0
)
new
->
flags
|=
CONTEXT_RA_STATELESS
|
CONTEXT_DHCP
|
CONTEXT_RA
;
new
->
flags
|=
CONTEXT_RA_STATELESS
|
CONTEXT_DHCP
|
CONTEXT_RA
;
else
if
(
strcmp
(
a
[
leasepos
],
"off-link"
)
==
0
)
new
->
flags
|=
CONTEXT_RA_OFF_LINK
;
else
if
(
leasepos
==
1
&&
inet_pton
(
AF_INET6
,
a
[
leasepos
],
&
new
->
end6
))
else
if
(
leasepos
==
1
&&
inet_pton
(
AF_INET6
,
a
[
leasepos
],
&
new
->
end6
))
new
->
flags
|=
CONTEXT_DHCP
;
new
->
flags
|=
CONTEXT_DHCP
;
else
if
(
strstr
(
a
[
leasepos
],
"constructor:"
)
==
a
[
leasepos
])
else
if
(
strstr
(
a
[
leasepos
],
"constructor:"
)
==
a
[
leasepos
])
...
...
src/radv.c
View file @
2fd5bc95
...
@@ -313,8 +313,10 @@ static void send_ra(time_t now, int iface, char *iface_name, struct in6_addr *de
...
@@ -313,8 +313,10 @@ static void send_ra(time_t now, int iface, char *iface_name, struct in6_addr *de
opt
->
type
=
ICMP6_OPT_PREFIX
;
opt
->
type
=
ICMP6_OPT_PREFIX
;
opt
->
len
=
4
;
opt
->
len
=
4
;
opt
->
prefix_len
=
context
->
prefix
;
opt
->
prefix_len
=
context
->
prefix
;
/* autonomous only if we're not doing dhcp, always set "on-link" */
/* autonomous only if we're not doing dhcp, set
opt
->
flags
=
do_slaac
?
0xC0
:
0x80
;
"on-link" unless "off-link" was specified */
opt
->
flags
=
(
do_slaac
?
0x40
:
0
)
|
((
context
->
flags
&
CONTEXT_RA_OFF_LINK
)
?
0
:
0x80
);
opt
->
valid_lifetime
=
htonl
(
context
->
saved_valid
-
old
);
opt
->
valid_lifetime
=
htonl
(
context
->
saved_valid
-
old
);
opt
->
preferred_lifetime
=
htonl
(
0
);
opt
->
preferred_lifetime
=
htonl
(
0
);
opt
->
reserved
=
0
;
opt
->
reserved
=
0
;
...
@@ -514,6 +516,7 @@ static int add_prefixes(struct in6_addr *local, int prefix,
...
@@ -514,6 +516,7 @@ static int add_prefixes(struct in6_addr *local, int prefix,
int
deprecate
=
0
;
int
deprecate
=
0
;
int
constructed
=
0
;
int
constructed
=
0
;
int
adv_router
=
0
;
int
adv_router
=
0
;
int
off_link
=
0
;
unsigned
int
time
=
0xffffffff
;
unsigned
int
time
=
0xffffffff
;
struct
dhcp_context
*
context
;
struct
dhcp_context
*
context
;
...
@@ -586,6 +589,7 @@ static int add_prefixes(struct in6_addr *local, int prefix,
...
@@ -586,6 +589,7 @@ static int add_prefixes(struct in6_addr *local, int prefix,
context
->
ra_time
=
0
;
context
->
ra_time
=
0
;
context
->
flags
|=
CONTEXT_RA_DONE
;
context
->
flags
|=
CONTEXT_RA_DONE
;
real_prefix
=
context
->
prefix
;
real_prefix
=
context
->
prefix
;
off_link
=
(
context
->
flags
&
CONTEXT_RA_OFF_LINK
);
}
}
param
->
first
=
0
;
param
->
first
=
0
;
...
@@ -636,8 +640,9 @@ static int add_prefixes(struct in6_addr *local, int prefix,
...
@@ -636,8 +640,9 @@ static int add_prefixes(struct in6_addr *local, int prefix,
opt
->
type
=
ICMP6_OPT_PREFIX
;
opt
->
type
=
ICMP6_OPT_PREFIX
;
opt
->
len
=
4
;
opt
->
len
=
4
;
opt
->
prefix_len
=
real_prefix
;
opt
->
prefix_len
=
real_prefix
;
/* autonomous only if we're not doing dhcp, always set "on-link" */
/* autonomous only if we're not doing dhcp, set
opt
->
flags
=
0x80
;
"on-link" unless "off-link" was specified */
opt
->
flags
=
(
off_link
?
0
:
0x80
);
if
(
do_slaac
)
if
(
do_slaac
)
opt
->
flags
|=
0x40
;
opt
->
flags
|=
0x40
;
if
(
adv_router
)
if
(
adv_router
)
...
...
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