Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
e1aafe5a
Commit
e1aafe5a
authored
Jan 16, 2005
by
Hideaki Yoshifuji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPV6] Don't use expired default routes.
Signed-off-by:
Hideaki YOSHIFUJI
<
yoshfuji@linux-ipv6.org
>
parent
62343f76
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
net/ipv6/route.c
net/ipv6/route.c
+13
-5
No files found.
net/ipv6/route.c
View file @
e1aafe5a
...
@@ -167,6 +167,12 @@ static void ip6_dst_ifdown(struct dst_entry *dst, int how)
...
@@ -167,6 +167,12 @@ static void ip6_dst_ifdown(struct dst_entry *dst, int how)
}
}
}
}
static
__inline__
int
rt6_check_expired
(
const
struct
rt6_info
*
rt
)
{
return
(
rt
->
rt6i_flags
&
RTF_EXPIRES
&&
time_after
(
jiffies
,
rt
->
rt6i_expires
));
}
/*
/*
* Route lookup. Any rt6_lock is implied.
* Route lookup. Any rt6_lock is implied.
*/
*/
...
@@ -237,8 +243,7 @@ static struct rt6_info *rt6_best_dflt(struct rt6_info *rt, int oif)
...
@@ -237,8 +243,7 @@ static struct rt6_info *rt6_best_dflt(struct rt6_info *rt, int oif)
sprt
->
rt6i_dev
->
ifindex
==
oif
))
sprt
->
rt6i_dev
->
ifindex
==
oif
))
m
+=
8
;
m
+=
8
;
if
((
sprt
->
rt6i_flags
&
RTF_EXPIRES
)
&&
if
(
rt6_check_expired
(
sprt
))
time_after
(
jiffies
,
sprt
->
rt6i_expires
))
continue
;
continue
;
if
(
sprt
==
rt6_dflt_pointer
)
if
(
sprt
==
rt6_dflt_pointer
)
...
@@ -296,7 +301,8 @@ static struct rt6_info *rt6_best_dflt(struct rt6_info *rt, int oif)
...
@@ -296,7 +301,8 @@ static struct rt6_info *rt6_best_dflt(struct rt6_info *rt, int oif)
for
(
sprt
=
rt6_dflt_pointer
->
u
.
next
;
for
(
sprt
=
rt6_dflt_pointer
->
u
.
next
;
sprt
;
sprt
=
sprt
->
u
.
next
)
{
sprt
;
sprt
=
sprt
->
u
.
next
)
{
if
(
sprt
->
u
.
dst
.
obsolete
<=
0
&&
if
(
sprt
->
u
.
dst
.
obsolete
<=
0
&&
sprt
->
u
.
dst
.
error
==
0
)
{
sprt
->
u
.
dst
.
error
==
0
&&
!
rt6_check_expired
(
sprt
))
{
match
=
sprt
;
match
=
sprt
;
break
;
break
;
}
}
...
@@ -305,7 +311,8 @@ static struct rt6_info *rt6_best_dflt(struct rt6_info *rt, int oif)
...
@@ -305,7 +311,8 @@ static struct rt6_info *rt6_best_dflt(struct rt6_info *rt, int oif)
!
match
&&
sprt
;
!
match
&&
sprt
;
sprt
=
sprt
->
u
.
next
)
{
sprt
=
sprt
->
u
.
next
)
{
if
(
sprt
->
u
.
dst
.
obsolete
<=
0
&&
if
(
sprt
->
u
.
dst
.
obsolete
<=
0
&&
sprt
->
u
.
dst
.
error
==
0
)
{
sprt
->
u
.
dst
.
error
==
0
&&
!
rt6_check_expired
(
sprt
))
{
match
=
sprt
;
match
=
sprt
;
break
;
break
;
}
}
...
@@ -331,7 +338,8 @@ static struct rt6_info *rt6_best_dflt(struct rt6_info *rt, int oif)
...
@@ -331,7 +338,8 @@ static struct rt6_info *rt6_best_dflt(struct rt6_info *rt, int oif)
*/
*/
for
(
sprt
=
ip6_routing_table
.
leaf
;
for
(
sprt
=
ip6_routing_table
.
leaf
;
sprt
;
sprt
=
sprt
->
u
.
next
)
{
sprt
;
sprt
=
sprt
->
u
.
next
)
{
if
((
sprt
->
rt6i_flags
&
RTF_DEFAULT
)
&&
if
(
!
rt6_check_expired
(
sprt
)
&&
(
sprt
->
rt6i_flags
&
RTF_DEFAULT
)
&&
(
!
oif
||
(
!
oif
||
(
sprt
->
rt6i_dev
&&
(
sprt
->
rt6i_dev
&&
sprt
->
rt6i_dev
->
ifindex
==
oif
)))
{
sprt
->
rt6i_dev
->
ifindex
==
oif
)))
{
...
...
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