diff options
author | Patrick McHardy <kaber@trash.net> | 2006-08-11 02:08:33 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-09-22 17:54:24 -0400 |
commit | 2dfe55b47e3d66ded5a84caf71e0da5710edf48b (patch) | |
tree | f3818a7016985f79856212d797921e319bff8cd2 /net | |
parent | d924424aaed116b362c6d0e667d912b77e655085 (diff) |
[NET]: Use u32 for routing table IDs
Use u32 for routing table IDs in net/ipv4 and net/decnet in preparation of
support for a larger number of routing tables. net/ipv6 already uses u32
everywhere and needs no further changes. No functional changes are made by
this patch.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/decnet/dn_fib.c | 6 | ||||
-rw-r--r-- | net/decnet/dn_table.c | 10 | ||||
-rw-r--r-- | net/ipv4/fib_frontend.c | 8 | ||||
-rw-r--r-- | net/ipv4/fib_hash.c | 4 | ||||
-rw-r--r-- | net/ipv4/fib_lookup.h | 4 | ||||
-rw-r--r-- | net/ipv4/fib_rules.c | 2 | ||||
-rw-r--r-- | net/ipv4/fib_semantics.c | 4 | ||||
-rw-r--r-- | net/ipv4/fib_trie.c | 6 |
8 files changed, 22 insertions, 22 deletions
diff --git a/net/decnet/dn_fib.c b/net/decnet/dn_fib.c index ed5fb5c3eab5..7b3bf5c3d720 100644 --- a/net/decnet/dn_fib.c +++ b/net/decnet/dn_fib.c | |||
@@ -534,8 +534,8 @@ int dn_fib_rtm_newroute(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) | |||
534 | 534 | ||
535 | int dn_fib_dump(struct sk_buff *skb, struct netlink_callback *cb) | 535 | int dn_fib_dump(struct sk_buff *skb, struct netlink_callback *cb) |
536 | { | 536 | { |
537 | int t; | 537 | u32 t; |
538 | int s_t; | 538 | u32 s_t; |
539 | struct dn_fib_table *tb; | 539 | struct dn_fib_table *tb; |
540 | 540 | ||
541 | if (NLMSG_PAYLOAD(cb->nlh, 0) >= sizeof(struct rtmsg) && | 541 | if (NLMSG_PAYLOAD(cb->nlh, 0) >= sizeof(struct rtmsg) && |
@@ -765,7 +765,7 @@ void dn_fib_flush(void) | |||
765 | { | 765 | { |
766 | int flushed = 0; | 766 | int flushed = 0; |
767 | struct dn_fib_table *tb; | 767 | struct dn_fib_table *tb; |
768 | int id; | 768 | u32 id; |
769 | 769 | ||
770 | for(id = RT_TABLE_MAX; id > 0; id--) { | 770 | for(id = RT_TABLE_MAX; id > 0; id--) { |
771 | if ((tb = dn_fib_get_table(id, 0)) == NULL) | 771 | if ((tb = dn_fib_get_table(id, 0)) == NULL) |
diff --git a/net/decnet/dn_table.c b/net/decnet/dn_table.c index 2e01b67398c8..1601ee5406a8 100644 --- a/net/decnet/dn_table.c +++ b/net/decnet/dn_table.c | |||
@@ -264,7 +264,7 @@ static int dn_fib_nh_match(struct rtmsg *r, struct nlmsghdr *nlh, struct dn_kern | |||
264 | } | 264 | } |
265 | 265 | ||
266 | static int dn_fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event, | 266 | static int dn_fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event, |
267 | u8 tb_id, u8 type, u8 scope, void *dst, int dst_len, | 267 | u32 tb_id, u8 type, u8 scope, void *dst, int dst_len, |
268 | struct dn_fib_info *fi, unsigned int flags) | 268 | struct dn_fib_info *fi, unsigned int flags) |
269 | { | 269 | { |
270 | struct rtmsg *rtm; | 270 | struct rtmsg *rtm; |
@@ -327,7 +327,7 @@ rtattr_failure: | |||
327 | } | 327 | } |
328 | 328 | ||
329 | 329 | ||
330 | static void dn_rtmsg_fib(int event, struct dn_fib_node *f, int z, int tb_id, | 330 | static void dn_rtmsg_fib(int event, struct dn_fib_node *f, int z, u32 tb_id, |
331 | struct nlmsghdr *nlh, struct netlink_skb_parms *req) | 331 | struct nlmsghdr *nlh, struct netlink_skb_parms *req) |
332 | { | 332 | { |
333 | struct sk_buff *skb; | 333 | struct sk_buff *skb; |
@@ -740,7 +740,7 @@ out: | |||
740 | } | 740 | } |
741 | 741 | ||
742 | 742 | ||
743 | struct dn_fib_table *dn_fib_get_table(int n, int create) | 743 | struct dn_fib_table *dn_fib_get_table(u32 n, int create) |
744 | { | 744 | { |
745 | struct dn_fib_table *t; | 745 | struct dn_fib_table *t; |
746 | 746 | ||
@@ -777,7 +777,7 @@ struct dn_fib_table *dn_fib_get_table(int n, int create) | |||
777 | return t; | 777 | return t; |
778 | } | 778 | } |
779 | 779 | ||
780 | static void dn_fib_del_tree(int n) | 780 | static void dn_fib_del_tree(u32 n) |
781 | { | 781 | { |
782 | struct dn_fib_table *t; | 782 | struct dn_fib_table *t; |
783 | 783 | ||
@@ -791,7 +791,7 @@ static void dn_fib_del_tree(int n) | |||
791 | 791 | ||
792 | struct dn_fib_table *dn_fib_empty_table(void) | 792 | struct dn_fib_table *dn_fib_empty_table(void) |
793 | { | 793 | { |
794 | int id; | 794 | u32 id; |
795 | 795 | ||
796 | for(id = RT_TABLE_MIN; id <= RT_TABLE_MAX; id++) | 796 | for(id = RT_TABLE_MIN; id <= RT_TABLE_MAX; id++) |
797 | if (dn_fib_tables[id] == NULL) | 797 | if (dn_fib_tables[id] == NULL) |
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index a83f1aa8034e..06f4b23f6f57 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c | |||
@@ -62,7 +62,7 @@ struct fib_table *ip_fib_main_table; | |||
62 | 62 | ||
63 | struct fib_table *fib_tables[RT_TABLE_MAX+1]; | 63 | struct fib_table *fib_tables[RT_TABLE_MAX+1]; |
64 | 64 | ||
65 | struct fib_table *__fib_new_table(int id) | 65 | struct fib_table *__fib_new_table(u32 id) |
66 | { | 66 | { |
67 | struct fib_table *tb; | 67 | struct fib_table *tb; |
68 | 68 | ||
@@ -82,7 +82,7 @@ static void fib_flush(void) | |||
82 | int flushed = 0; | 82 | int flushed = 0; |
83 | #ifdef CONFIG_IP_MULTIPLE_TABLES | 83 | #ifdef CONFIG_IP_MULTIPLE_TABLES |
84 | struct fib_table *tb; | 84 | struct fib_table *tb; |
85 | int id; | 85 | u32 id; |
86 | 86 | ||
87 | for (id = RT_TABLE_MAX; id>0; id--) { | 87 | for (id = RT_TABLE_MAX; id>0; id--) { |
88 | if ((tb = fib_get_table(id))==NULL) | 88 | if ((tb = fib_get_table(id))==NULL) |
@@ -333,8 +333,8 @@ int inet_rtm_newroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) | |||
333 | 333 | ||
334 | int inet_dump_fib(struct sk_buff *skb, struct netlink_callback *cb) | 334 | int inet_dump_fib(struct sk_buff *skb, struct netlink_callback *cb) |
335 | { | 335 | { |
336 | int t; | 336 | u32 t; |
337 | int s_t; | 337 | u32 s_t; |
338 | struct fib_table *tb; | 338 | struct fib_table *tb; |
339 | 339 | ||
340 | if (NLMSG_PAYLOAD(cb->nlh, 0) >= sizeof(struct rtmsg) && | 340 | if (NLMSG_PAYLOAD(cb->nlh, 0) >= sizeof(struct rtmsg) && |
diff --git a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c index 72c633b357cf..f8d5c8024ccb 100644 --- a/net/ipv4/fib_hash.c +++ b/net/ipv4/fib_hash.c | |||
@@ -765,9 +765,9 @@ static int fn_hash_dump(struct fib_table *tb, struct sk_buff *skb, struct netlin | |||
765 | } | 765 | } |
766 | 766 | ||
767 | #ifdef CONFIG_IP_MULTIPLE_TABLES | 767 | #ifdef CONFIG_IP_MULTIPLE_TABLES |
768 | struct fib_table * fib_hash_init(int id) | 768 | struct fib_table * fib_hash_init(u32 id) |
769 | #else | 769 | #else |
770 | struct fib_table * __init fib_hash_init(int id) | 770 | struct fib_table * __init fib_hash_init(u32 id) |
771 | #endif | 771 | #endif |
772 | { | 772 | { |
773 | struct fib_table *tb; | 773 | struct fib_table *tb; |
diff --git a/net/ipv4/fib_lookup.h b/net/ipv4/fib_lookup.h index ef6609ea0eb7..ddd52496b451 100644 --- a/net/ipv4/fib_lookup.h +++ b/net/ipv4/fib_lookup.h | |||
@@ -30,11 +30,11 @@ extern struct fib_info *fib_create_info(const struct rtmsg *r, | |||
30 | extern int fib_nh_match(struct rtmsg *r, struct nlmsghdr *, | 30 | extern int fib_nh_match(struct rtmsg *r, struct nlmsghdr *, |
31 | struct kern_rta *rta, struct fib_info *fi); | 31 | struct kern_rta *rta, struct fib_info *fi); |
32 | extern int fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event, | 32 | extern int fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event, |
33 | u8 tb_id, u8 type, u8 scope, void *dst, | 33 | u32 tb_id, u8 type, u8 scope, void *dst, |
34 | int dst_len, u8 tos, struct fib_info *fi, | 34 | int dst_len, u8 tos, struct fib_info *fi, |
35 | unsigned int); | 35 | unsigned int); |
36 | extern void rtmsg_fib(int event, u32 key, struct fib_alias *fa, | 36 | extern void rtmsg_fib(int event, u32 key, struct fib_alias *fa, |
37 | int z, int tb_id, | 37 | int z, u32 tb_id, |
38 | struct nlmsghdr *n, struct netlink_skb_parms *req); | 38 | struct nlmsghdr *n, struct netlink_skb_parms *req); |
39 | extern struct fib_alias *fib_find_alias(struct list_head *fah, | 39 | extern struct fib_alias *fib_find_alias(struct list_head *fah, |
40 | u8 tos, u32 prio); | 40 | u8 tos, u32 prio); |
diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c index d242e5291fcc..58fb91b00fdf 100644 --- a/net/ipv4/fib_rules.c +++ b/net/ipv4/fib_rules.c | |||
@@ -169,7 +169,7 @@ static int fib4_rule_match(struct fib_rule *rule, struct flowi *fl, int flags) | |||
169 | 169 | ||
170 | static struct fib_table *fib_empty_table(void) | 170 | static struct fib_table *fib_empty_table(void) |
171 | { | 171 | { |
172 | int id; | 172 | u32 id; |
173 | 173 | ||
174 | for (id = 1; id <= RT_TABLE_MAX; id++) | 174 | for (id = 1; id <= RT_TABLE_MAX; id++) |
175 | if (fib_tables[id] == NULL) | 175 | if (fib_tables[id] == NULL) |
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index 38bca473c7e2..c7a112b5a185 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c | |||
@@ -273,7 +273,7 @@ int ip_fib_check_default(u32 gw, struct net_device *dev) | |||
273 | } | 273 | } |
274 | 274 | ||
275 | void rtmsg_fib(int event, u32 key, struct fib_alias *fa, | 275 | void rtmsg_fib(int event, u32 key, struct fib_alias *fa, |
276 | int z, int tb_id, | 276 | int z, u32 tb_id, |
277 | struct nlmsghdr *n, struct netlink_skb_parms *req) | 277 | struct nlmsghdr *n, struct netlink_skb_parms *req) |
278 | { | 278 | { |
279 | struct sk_buff *skb; | 279 | struct sk_buff *skb; |
@@ -939,7 +939,7 @@ u32 __fib_res_prefsrc(struct fib_result *res) | |||
939 | 939 | ||
940 | int | 940 | int |
941 | fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event, | 941 | fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event, |
942 | u8 tb_id, u8 type, u8 scope, void *dst, int dst_len, u8 tos, | 942 | u32 tb_id, u8 type, u8 scope, void *dst, int dst_len, u8 tos, |
943 | struct fib_info *fi, unsigned int flags) | 943 | struct fib_info *fi, unsigned int flags) |
944 | { | 944 | { |
945 | struct rtmsg *rtm; | 945 | struct rtmsg *rtm; |
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index 01801c0f885d..4a27b2d573a3 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c | |||
@@ -1148,7 +1148,7 @@ fn_trie_insert(struct fib_table *tb, struct rtmsg *r, struct kern_rta *rta, | |||
1148 | 1148 | ||
1149 | key = ntohl(key); | 1149 | key = ntohl(key); |
1150 | 1150 | ||
1151 | pr_debug("Insert table=%d %08x/%d\n", tb->tb_id, key, plen); | 1151 | pr_debug("Insert table=%u %08x/%d\n", tb->tb_id, key, plen); |
1152 | 1152 | ||
1153 | mask = ntohl(inet_make_mask(plen)); | 1153 | mask = ntohl(inet_make_mask(plen)); |
1154 | 1154 | ||
@@ -1943,9 +1943,9 @@ out: | |||
1943 | /* Fix more generic FIB names for init later */ | 1943 | /* Fix more generic FIB names for init later */ |
1944 | 1944 | ||
1945 | #ifdef CONFIG_IP_MULTIPLE_TABLES | 1945 | #ifdef CONFIG_IP_MULTIPLE_TABLES |
1946 | struct fib_table * fib_hash_init(int id) | 1946 | struct fib_table * fib_hash_init(u32 id) |
1947 | #else | 1947 | #else |
1948 | struct fib_table * __init fib_hash_init(int id) | 1948 | struct fib_table * __init fib_hash_init(u32 id) |
1949 | #endif | 1949 | #endif |
1950 | { | 1950 | { |
1951 | struct fib_table *tb; | 1951 | struct fib_table *tb; |