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
nexedi
linux
Commits
c6e97af6
Commit
c6e97af6
authored
Jun 01, 2004
by
Hideaki Yoshifuji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPV4]: Store idev in routes.
parent
d10920ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
include/net/route.h
include/net/route.h
+2
-0
net/ipv4/route.c
net/ipv4/route.c
+12
-0
No files found.
include/net/route.h
View file @
c6e97af6
...
@@ -55,6 +55,8 @@ struct rtable
...
@@ -55,6 +55,8 @@ struct rtable
struct
rtable
*
rt_next
;
struct
rtable
*
rt_next
;
}
u
;
}
u
;
struct
in_device
*
idev
;
unsigned
rt_flags
;
unsigned
rt_flags
;
unsigned
rt_type
;
unsigned
rt_type
;
...
...
net/ipv4/route.c
View file @
c6e97af6
...
@@ -1040,6 +1040,8 @@ void ip_rt_redirect(u32 old_gw, u32 daddr, u32 new_gw,
...
@@ -1040,6 +1040,8 @@ void ip_rt_redirect(u32 old_gw, u32 daddr, u32 new_gw,
rt
->
u
.
dst
.
child
=
NULL
;
rt
->
u
.
dst
.
child
=
NULL
;
if
(
rt
->
u
.
dst
.
dev
)
if
(
rt
->
u
.
dst
.
dev
)
dev_hold
(
rt
->
u
.
dst
.
dev
);
dev_hold
(
rt
->
u
.
dst
.
dev
);
if
(
rt
->
idev
)
in_dev_hold
(
rt
->
idev
);
rt
->
u
.
dst
.
obsolete
=
0
;
rt
->
u
.
dst
.
obsolete
=
0
;
rt
->
u
.
dst
.
lastuse
=
jiffies
;
rt
->
u
.
dst
.
lastuse
=
jiffies
;
rt
->
u
.
dst
.
path
=
&
rt
->
u
.
dst
;
rt
->
u
.
dst
.
path
=
&
rt
->
u
.
dst
;
...
@@ -1321,11 +1323,17 @@ static void ipv4_dst_destroy(struct dst_entry *dst)
...
@@ -1321,11 +1323,17 @@ static void ipv4_dst_destroy(struct dst_entry *dst)
{
{
struct
rtable
*
rt
=
(
struct
rtable
*
)
dst
;
struct
rtable
*
rt
=
(
struct
rtable
*
)
dst
;
struct
inet_peer
*
peer
=
rt
->
peer
;
struct
inet_peer
*
peer
=
rt
->
peer
;
struct
in_device
*
idev
=
rt
->
idev
;
if
(
peer
)
{
if
(
peer
)
{
rt
->
peer
=
NULL
;
rt
->
peer
=
NULL
;
inet_putpeer
(
peer
);
inet_putpeer
(
peer
);
}
}
if
(
idev
)
{
rt
->
idev
=
NULL
;
in_dev_put
(
idev
);
}
}
}
static
void
ipv4_link_failure
(
struct
sk_buff
*
skb
)
static
void
ipv4_link_failure
(
struct
sk_buff
*
skb
)
...
@@ -1486,6 +1494,7 @@ static int ip_route_input_mc(struct sk_buff *skb, u32 daddr, u32 saddr,
...
@@ -1486,6 +1494,7 @@ static int ip_route_input_mc(struct sk_buff *skb, u32 daddr, u32 saddr,
rth
->
fl
.
iif
=
dev
->
ifindex
;
rth
->
fl
.
iif
=
dev
->
ifindex
;
rth
->
u
.
dst
.
dev
=
&
loopback_dev
;
rth
->
u
.
dst
.
dev
=
&
loopback_dev
;
dev_hold
(
rth
->
u
.
dst
.
dev
);
dev_hold
(
rth
->
u
.
dst
.
dev
);
rth
->
idev
=
in_dev_get
(
rth
->
u
.
dst
.
dev
);
rth
->
fl
.
oif
=
0
;
rth
->
fl
.
oif
=
0
;
rth
->
rt_gateway
=
daddr
;
rth
->
rt_gateway
=
daddr
;
rth
->
rt_spec_dst
=
spec_dst
;
rth
->
rt_spec_dst
=
spec_dst
;
...
@@ -1695,6 +1704,7 @@ static int ip_route_input_slow(struct sk_buff *skb, u32 daddr, u32 saddr,
...
@@ -1695,6 +1704,7 @@ static int ip_route_input_slow(struct sk_buff *skb, u32 daddr, u32 saddr,
rth
->
fl
.
iif
=
dev
->
ifindex
;
rth
->
fl
.
iif
=
dev
->
ifindex
;
rth
->
u
.
dst
.
dev
=
out_dev
->
dev
;
rth
->
u
.
dst
.
dev
=
out_dev
->
dev
;
dev_hold
(
rth
->
u
.
dst
.
dev
);
dev_hold
(
rth
->
u
.
dst
.
dev
);
rth
->
idev
=
in_dev_get
(
rth
->
u
.
dst
.
dev
);
rth
->
fl
.
oif
=
0
;
rth
->
fl
.
oif
=
0
;
rth
->
rt_spec_dst
=
spec_dst
;
rth
->
rt_spec_dst
=
spec_dst
;
...
@@ -1774,6 +1784,7 @@ out: return err;
...
@@ -1774,6 +1784,7 @@ out: return err;
rth
->
fl
.
iif
=
dev
->
ifindex
;
rth
->
fl
.
iif
=
dev
->
ifindex
;
rth
->
u
.
dst
.
dev
=
&
loopback_dev
;
rth
->
u
.
dst
.
dev
=
&
loopback_dev
;
dev_hold
(
rth
->
u
.
dst
.
dev
);
dev_hold
(
rth
->
u
.
dst
.
dev
);
rth
->
idev
=
in_dev_get
(
rth
->
u
.
dst
.
dev
);
rth
->
rt_gateway
=
daddr
;
rth
->
rt_gateway
=
daddr
;
rth
->
rt_spec_dst
=
spec_dst
;
rth
->
rt_spec_dst
=
spec_dst
;
rth
->
u
.
dst
.
input
=
ip_local_deliver
;
rth
->
u
.
dst
.
input
=
ip_local_deliver
;
...
@@ -2157,6 +2168,7 @@ static int ip_route_output_slow(struct rtable **rp, const struct flowi *oldflp)
...
@@ -2157,6 +2168,7 @@ static int ip_route_output_slow(struct rtable **rp, const struct flowi *oldflp)
rth
->
rt_iif
=
oldflp
->
oif
?
:
dev_out
->
ifindex
;
rth
->
rt_iif
=
oldflp
->
oif
?
:
dev_out
->
ifindex
;
rth
->
u
.
dst
.
dev
=
dev_out
;
rth
->
u
.
dst
.
dev
=
dev_out
;
dev_hold
(
dev_out
);
dev_hold
(
dev_out
);
rth
->
idev
=
in_dev_get
(
dev_out
);
rth
->
rt_gateway
=
fl
.
fl4_dst
;
rth
->
rt_gateway
=
fl
.
fl4_dst
;
rth
->
rt_spec_dst
=
fl
.
fl4_src
;
rth
->
rt_spec_dst
=
fl
.
fl4_src
;
...
...
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