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
29d28dda
Commit
29d28dda
authored
Dec 03, 2012
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't send RAs to the wrong place when DAD in progress.
parent
421594f8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
18 deletions
+32
-18
CHANGELOG
CHANGELOG
+9
-0
src/forward.c
src/forward.c
+7
-14
src/radv.c
src/radv.c
+16
-4
No files found.
CHANGELOG
View file @
29d28dda
...
@@ -59,6 +59,15 @@ version 2.64
...
@@ -59,6 +59,15 @@ version 2.64
advertisements, rather than relying on interface address
advertisements, rather than relying on interface address
configuration. Thanks to Gene Czarinski for the patch.
configuration. Thanks to Gene Czarinski for the patch.
Handle better attempts to transmit on interfaces which are
still doing DAD, and specifically do not just transmit
without setting source address and interface, since this
can cause very puzzling effects when a router
advertisement goes astray. Thanks again to Gene Czarinski.
Get RA timers right when there is more than one
dhcp-range on a subnet.
version 2.63
version 2.63
Do duplicate dhcp-host address check in --test mode.
Do duplicate dhcp-host address check in --test mode.
...
...
src/forward.c
View file @
29d28dda
...
@@ -95,23 +95,16 @@ int send_from(int fd, int nowild, char *packet, size_t len,
...
@@ -95,23 +95,16 @@ int send_from(int fd, int nowild, char *packet, size_t len,
#endif
#endif
}
}
retry:
while
(
sendmsg
(
fd
,
&
msg
,
0
)
==
-
1
)
if
(
sendmsg
(
fd
,
&
msg
,
0
)
==
-
1
)
{
{
/* certain Linux kernels seem to object to setting the source address in the IPv6 stack
by returning EINVAL from sendmsg. In that case, try again without setting the
source address, since it will nearly alway be correct anyway. IPv6 stinks. */
if
(
errno
==
EINVAL
&&
msg
.
msg_controllen
)
{
msg
.
msg_controllen
=
0
;
goto
retry
;
}
if
(
retry_send
())
if
(
retry_send
())
goto
retry
;
continue
;
my_syslog
(
LOG_ERR
,
_
(
"failed to send packet: %s"
),
strerror
(
errno
));
/* If interface is still in DAD, EINVAL results - ignore that. */
if
(
errno
==
EINVAL
)
break
;
my_syslog
(
LOG_ERR
,
_
(
"failed to send packet: %s"
),
strerror
(
errno
));
return
0
;
return
0
;
}
}
...
...
src/radv.c
View file @
29d28dda
...
@@ -457,6 +457,7 @@ time_t periodic_ra(time_t now)
...
@@ -457,6 +457,7 @@ time_t periodic_ra(time_t now)
char
interface
[
IF_NAMESIZE
+
1
];
char
interface
[
IF_NAMESIZE
+
1
];
param
.
now
=
now
;
param
.
now
=
now
;
param
.
iface
=
0
;
while
(
1
)
while
(
1
)
{
{
...
@@ -482,7 +483,8 @@ time_t periodic_ra(time_t now)
...
@@ -482,7 +483,8 @@ time_t periodic_ra(time_t now)
ever be able to send ra's and satistfy it. */
ever be able to send ra's and satistfy it. */
if
(
iface_enumerate
(
AF_INET6
,
&
param
,
iface_search
))
if
(
iface_enumerate
(
AF_INET6
,
&
param
,
iface_search
))
context
->
ra_time
=
0
;
context
->
ra_time
=
0
;
else
if
(
indextoname
(
daemon
->
icmp6fd
,
param
.
iface
,
interface
)
&&
else
if
(
param
.
iface
!=
0
&&
indextoname
(
daemon
->
icmp6fd
,
param
.
iface
,
interface
)
&&
iface_check
(
AF_LOCAL
,
NULL
,
interface
))
iface_check
(
AF_LOCAL
,
NULL
,
interface
))
{
{
struct
iname
*
tmp
;
struct
iname
*
tmp
;
...
@@ -512,8 +514,10 @@ static int iface_search(struct in6_addr *local, int prefix,
...
@@ -512,8 +514,10 @@ static int iface_search(struct in6_addr *local, int prefix,
if
(
context
->
ra_time
!=
0
&&
difftime
(
context
->
ra_time
,
param
->
now
)
<=
0
.
0
)
if
(
context
->
ra_time
!=
0
&&
difftime
(
context
->
ra_time
,
param
->
now
)
<=
0
.
0
)
{
{
/* found an interface that's overdue for RA determine new
/* found an interface that's overdue for RA determine new
timeout value and zap other contexts on the same interface
timeout value and arrange for RA to be sent unless interface is
so they don't timeout independently .*/
still doing DAD.*/
if
(
!
dad
)
param
->
iface
=
if_index
;
param
->
iface
=
if_index
;
if
(
difftime
(
param
->
now
,
ra_short_period_start
)
<
60
.
0
)
if
(
difftime
(
param
->
now
,
ra_short_period_start
)
<
60
.
0
)
...
@@ -523,6 +527,14 @@ static int iface_search(struct in6_addr *local, int prefix,
...
@@ -523,6 +527,14 @@ static int iface_search(struct in6_addr *local, int prefix,
/* range 450 - 600 */
/* range 450 - 600 */
context
->
ra_time
=
param
->
now
+
450
+
(
rand16
()
/
440
);
context
->
ra_time
=
param
->
now
+
450
+
(
rand16
()
/
440
);
/* zero timers for other contexts on the same subnet, so they don't timeout
independently */
for
(
context
=
context
->
next
;
context
;
context
=
context
->
next
)
if
(
prefix
==
context
->
prefix
&&
is_same_net6
(
local
,
&
context
->
start6
,
prefix
)
&&
is_same_net6
(
local
,
&
context
->
end6
,
prefix
))
context
->
ra_time
=
0
;
return
0
;
/* found, abort */
return
0
;
/* found, abort */
}
}
...
...
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