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
8e773277
Commit
8e773277
authored
Jun 11, 2012
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inet: Add inetpeer tree roots to the FIB tables.
Signed-off-by:
David S. Miller
<
davem@davemloft.net
>
parent
b48c80ec
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
5 deletions
+16
-5
include/net/ip6_fib.h
include/net/ip6_fib.h
+1
-0
include/net/ip_fib.h
include/net/ip_fib.h
+7
-5
net/ipv4/fib_trie.c
net/ipv4/fib_trie.c
+3
-0
net/ipv6/ip6_fib.c
net/ipv6/ip6_fib.c
+5
-0
No files found.
include/net/ip6_fib.h
View file @
8e773277
...
...
@@ -237,6 +237,7 @@ struct fib6_table {
u32
tb6_id
;
rwlock_t
tb6_lock
;
struct
fib6_node
tb6_root
;
struct
inet_peer_base
tb6_peers
;
};
#define RT6_TABLE_UNSPEC RT_TABLE_UNSPEC
...
...
include/net/ip_fib.h
View file @
8e773277
...
...
@@ -19,6 +19,7 @@
#include <net/flow.h>
#include <linux/seq_file.h>
#include <net/fib_rules.h>
#include <net/inetpeer.h>
struct
fib_config
{
u8
fc_dst_len
;
...
...
@@ -157,11 +158,12 @@ extern __be32 fib_info_update_nh_saddr(struct net *net, struct fib_nh *nh);
FIB_RES_SADDR(net, res))
struct
fib_table
{
struct
hlist_node
tb_hlist
;
u32
tb_id
;
int
tb_default
;
int
tb_num_default
;
unsigned
long
tb_data
[
0
];
struct
hlist_node
tb_hlist
;
u32
tb_id
;
int
tb_default
;
int
tb_num_default
;
struct
inet_peer_base
tb_peers
;
unsigned
long
tb_data
[
0
];
};
extern
int
fib_table_lookup
(
struct
fib_table
*
tb
,
const
struct
flowi4
*
flp
,
...
...
net/ipv4/fib_trie.c
View file @
8e773277
...
...
@@ -1843,6 +1843,8 @@ int fib_table_flush(struct fib_table *tb)
if
(
ll
&&
hlist_empty
(
&
ll
->
list
))
trie_leaf_remove
(
t
,
ll
);
inetpeer_invalidate_tree
(
&
tb
->
tb_peers
);
pr_debug
(
"trie_flush found=%d
\n
"
,
found
);
return
found
;
}
...
...
@@ -1991,6 +1993,7 @@ struct fib_table *fib_trie_table(u32 id)
tb
->
tb_id
=
id
;
tb
->
tb_default
=
-
1
;
tb
->
tb_num_default
=
0
;
inet_peer_base_init
(
&
tb
->
tb_peers
);
t
=
(
struct
trie
*
)
tb
->
tb_data
;
memset
(
t
,
0
,
sizeof
(
*
t
));
...
...
net/ipv6/ip6_fib.c
View file @
8e773277
...
...
@@ -197,6 +197,7 @@ static struct fib6_table *fib6_alloc_table(struct net *net, u32 id)
table
->
tb6_id
=
id
;
table
->
tb6_root
.
leaf
=
net
->
ipv6
.
ip6_null_entry
;
table
->
tb6_root
.
fn_flags
=
RTN_ROOT
|
RTN_TL_ROOT
|
RTN_RTINFO
;
inet_peer_base_init
(
&
table
->
tb6_peers
);
}
return
table
;
...
...
@@ -1633,6 +1634,7 @@ static int __net_init fib6_net_init(struct net *net)
net
->
ipv6
.
fib6_main_tbl
->
tb6_root
.
leaf
=
net
->
ipv6
.
ip6_null_entry
;
net
->
ipv6
.
fib6_main_tbl
->
tb6_root
.
fn_flags
=
RTN_ROOT
|
RTN_TL_ROOT
|
RTN_RTINFO
;
inet_peer_base_init
(
&
net
->
ipv6
.
fib6_main_tbl
->
tb6_peers
);
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
net
->
ipv6
.
fib6_local_tbl
=
kzalloc
(
sizeof
(
*
net
->
ipv6
.
fib6_local_tbl
),
...
...
@@ -1643,6 +1645,7 @@ static int __net_init fib6_net_init(struct net *net)
net
->
ipv6
.
fib6_local_tbl
->
tb6_root
.
leaf
=
net
->
ipv6
.
ip6_null_entry
;
net
->
ipv6
.
fib6_local_tbl
->
tb6_root
.
fn_flags
=
RTN_ROOT
|
RTN_TL_ROOT
|
RTN_RTINFO
;
inet_peer_base_init
(
&
net
->
ipv6
.
fib6_local_tbl
->
tb6_peers
);
#endif
fib6_tables_init
(
net
);
...
...
@@ -1666,8 +1669,10 @@ static void fib6_net_exit(struct net *net)
del_timer_sync
(
&
net
->
ipv6
.
ip6_fib_timer
);
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
inetpeer_invalidate_tree
(
&
net
->
ipv6
.
fib6_local_tbl
->
tb6_peers
);
kfree
(
net
->
ipv6
.
fib6_local_tbl
);
#endif
inetpeer_invalidate_tree
(
&
net
->
ipv6
.
fib6_main_tbl
->
tb6_peers
);
kfree
(
net
->
ipv6
.
fib6_main_tbl
);
kfree
(
net
->
ipv6
.
fib_table_hash
);
kfree
(
net
->
ipv6
.
rt6_stats
);
...
...
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