diff options
-rw-r--r-- | include/net/ip_fib.h | 2 | ||||
-rw-r--r-- | net/ipv4/fib_frontend.c | 7 | ||||
-rw-r--r-- | net/ipv4/fib_lookup.h | 4 | ||||
-rw-r--r-- | net/ipv4/fib_rules.c | 12 | ||||
-rw-r--r-- | net/ipv4/fib_semantics.c | 12 |
5 files changed, 18 insertions, 19 deletions
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index 19f70896ea98..82229146bac7 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h | |||
@@ -230,7 +230,7 @@ struct rtentry; | |||
230 | 230 | ||
231 | /* Exported by fib_semantics.c */ | 231 | /* Exported by fib_semantics.c */ |
232 | extern int ip_fib_check_default(__be32 gw, struct net_device *dev); | 232 | extern int ip_fib_check_default(__be32 gw, struct net_device *dev); |
233 | extern int fib_sync_down(u32 local, struct net_device *dev, int force); | 233 | extern int fib_sync_down(__be32 local, struct net_device *dev, int force); |
234 | extern int fib_sync_up(struct net_device *dev); | 234 | extern int fib_sync_up(struct net_device *dev); |
235 | extern __be32 __fib_res_prefsrc(struct fib_result *res); | 235 | extern __be32 __fib_res_prefsrc(struct fib_result *res); |
236 | 236 | ||
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 34dc640478a0..9c399a70dd5d 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c | |||
@@ -253,7 +253,7 @@ e_inval: | |||
253 | 253 | ||
254 | #ifndef CONFIG_IP_NOSIOCRT | 254 | #ifndef CONFIG_IP_NOSIOCRT |
255 | 255 | ||
256 | static inline u32 sk_extract_addr(struct sockaddr *addr) | 256 | static inline __be32 sk_extract_addr(struct sockaddr *addr) |
257 | { | 257 | { |
258 | return ((struct sockaddr_in *) addr)->sin_addr.s_addr; | 258 | return ((struct sockaddr_in *) addr)->sin_addr.s_addr; |
259 | } | 259 | } |
@@ -292,7 +292,7 @@ static int rtentry_to_fib_config(int cmd, struct rtentry *rt, | |||
292 | plen = 32; | 292 | plen = 32; |
293 | addr = sk_extract_addr(&rt->rt_dst); | 293 | addr = sk_extract_addr(&rt->rt_dst); |
294 | if (!(rt->rt_flags & RTF_HOST)) { | 294 | if (!(rt->rt_flags & RTF_HOST)) { |
295 | u32 mask = sk_extract_addr(&rt->rt_genmask); | 295 | __be32 mask = sk_extract_addr(&rt->rt_genmask); |
296 | 296 | ||
297 | if (rt->rt_genmask.sa_family != AF_INET) { | 297 | if (rt->rt_genmask.sa_family != AF_INET) { |
298 | if (mask || rt->rt_genmask.sa_family) | 298 | if (mask || rt->rt_genmask.sa_family) |
@@ -627,8 +627,7 @@ out: | |||
627 | only when netlink is already locked. | 627 | only when netlink is already locked. |
628 | */ | 628 | */ |
629 | 629 | ||
630 | static void fib_magic(int cmd, int type, u32 dst, int dst_len, | 630 | static void fib_magic(int cmd, int type, __be32 dst, int dst_len, struct in_ifaddr *ifa) |
631 | struct in_ifaddr *ifa) | ||
632 | { | 631 | { |
633 | struct fib_table *tb; | 632 | struct fib_table *tb; |
634 | struct fib_config cfg = { | 633 | struct fib_config cfg = { |
diff --git a/net/ipv4/fib_lookup.h b/net/ipv4/fib_lookup.h index 6e9b3e86ae84..0e8b70bad4e1 100644 --- a/net/ipv4/fib_lookup.h +++ b/net/ipv4/fib_lookup.h | |||
@@ -26,10 +26,10 @@ extern void fib_release_info(struct fib_info *); | |||
26 | extern struct fib_info *fib_create_info(struct fib_config *cfg); | 26 | extern struct fib_info *fib_create_info(struct fib_config *cfg); |
27 | extern int fib_nh_match(struct fib_config *cfg, struct fib_info *fi); | 27 | extern int fib_nh_match(struct fib_config *cfg, struct fib_info *fi); |
28 | extern int fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event, | 28 | extern int fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event, |
29 | u32 tb_id, u8 type, u8 scope, u32 dst, | 29 | u32 tb_id, u8 type, u8 scope, __be32 dst, |
30 | int dst_len, u8 tos, struct fib_info *fi, | 30 | int dst_len, u8 tos, struct fib_info *fi, |
31 | unsigned int); | 31 | unsigned int); |
32 | extern void rtmsg_fib(int event, u32 key, struct fib_alias *fa, | 32 | extern void rtmsg_fib(int event, __be32 key, struct fib_alias *fa, |
33 | int dst_len, u32 tb_id, struct nl_info *info); | 33 | int dst_len, u32 tb_id, struct nl_info *info); |
34 | extern struct fib_alias *fib_find_alias(struct list_head *fah, | 34 | extern struct fib_alias *fib_find_alias(struct list_head *fah, |
35 | u8 tos, u32 prio); | 35 | u8 tos, u32 prio); |
diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c index 52b2adae4f22..f2d4070aaf01 100644 --- a/net/ipv4/fib_rules.c +++ b/net/ipv4/fib_rules.c | |||
@@ -40,10 +40,10 @@ struct fib4_rule | |||
40 | u8 dst_len; | 40 | u8 dst_len; |
41 | u8 src_len; | 41 | u8 src_len; |
42 | u8 tos; | 42 | u8 tos; |
43 | u32 src; | 43 | __be32 src; |
44 | u32 srcmask; | 44 | __be32 srcmask; |
45 | u32 dst; | 45 | __be32 dst; |
46 | u32 dstmask; | 46 | __be32 dstmask; |
47 | #ifdef CONFIG_IP_ROUTE_FWMARK | 47 | #ifdef CONFIG_IP_ROUTE_FWMARK |
48 | u32 fwmark; | 48 | u32 fwmark; |
49 | u32 fwmask; | 49 | u32 fwmask; |
@@ -150,8 +150,8 @@ void fib_select_default(const struct flowi *flp, struct fib_result *res) | |||
150 | static int fib4_rule_match(struct fib_rule *rule, struct flowi *fl, int flags) | 150 | static int fib4_rule_match(struct fib_rule *rule, struct flowi *fl, int flags) |
151 | { | 151 | { |
152 | struct fib4_rule *r = (struct fib4_rule *) rule; | 152 | struct fib4_rule *r = (struct fib4_rule *) rule; |
153 | u32 daddr = fl->fl4_dst; | 153 | __be32 daddr = fl->fl4_dst; |
154 | u32 saddr = fl->fl4_src; | 154 | __be32 saddr = fl->fl4_src; |
155 | 155 | ||
156 | if (((saddr ^ r->src) & r->srcmask) || | 156 | if (((saddr ^ r->src) & r->srcmask) || |
157 | ((daddr ^ r->dst) & r->dstmask)) | 157 | ((daddr ^ r->dst) & r->dstmask)) |
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index f7567e92cd9e..884d176e0082 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c | |||
@@ -203,7 +203,7 @@ static inline unsigned int fib_info_hashfn(const struct fib_info *fi) | |||
203 | unsigned int val = fi->fib_nhs; | 203 | unsigned int val = fi->fib_nhs; |
204 | 204 | ||
205 | val ^= fi->fib_protocol; | 205 | val ^= fi->fib_protocol; |
206 | val ^= fi->fib_prefsrc; | 206 | val ^= (__force u32)fi->fib_prefsrc; |
207 | val ^= fi->fib_priority; | 207 | val ^= fi->fib_priority; |
208 | 208 | ||
209 | return (val ^ (val >> 7) ^ (val >> 12)) & mask; | 209 | return (val ^ (val >> 7) ^ (val >> 12)) & mask; |
@@ -273,7 +273,7 @@ int ip_fib_check_default(__be32 gw, struct net_device *dev) | |||
273 | return -1; | 273 | return -1; |
274 | } | 274 | } |
275 | 275 | ||
276 | void rtmsg_fib(int event, u32 key, struct fib_alias *fa, | 276 | void rtmsg_fib(int event, __be32 key, struct fib_alias *fa, |
277 | int dst_len, u32 tb_id, struct nl_info *info) | 277 | int dst_len, u32 tb_id, struct nl_info *info) |
278 | { | 278 | { |
279 | struct sk_buff *skb; | 279 | struct sk_buff *skb; |
@@ -568,11 +568,11 @@ out: | |||
568 | return 0; | 568 | return 0; |
569 | } | 569 | } |
570 | 570 | ||
571 | static inline unsigned int fib_laddr_hashfn(u32 val) | 571 | static inline unsigned int fib_laddr_hashfn(__be32 val) |
572 | { | 572 | { |
573 | unsigned int mask = (fib_hash_size - 1); | 573 | unsigned int mask = (fib_hash_size - 1); |
574 | 574 | ||
575 | return (val ^ (val >> 7) ^ (val >> 14)) & mask; | 575 | return ((__force u32)val ^ ((__force u32)val >> 7) ^ ((__force u32)val >> 14)) & mask; |
576 | } | 576 | } |
577 | 577 | ||
578 | static struct hlist_head *fib_hash_alloc(int bytes) | 578 | static struct hlist_head *fib_hash_alloc(int bytes) |
@@ -928,7 +928,7 @@ __be32 __fib_res_prefsrc(struct fib_result *res) | |||
928 | } | 928 | } |
929 | 929 | ||
930 | int fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event, | 930 | int fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event, |
931 | u32 tb_id, u8 type, u8 scope, u32 dst, int dst_len, u8 tos, | 931 | u32 tb_id, u8 type, u8 scope, __be32 dst, int dst_len, u8 tos, |
932 | struct fib_info *fi, unsigned int flags) | 932 | struct fib_info *fi, unsigned int flags) |
933 | { | 933 | { |
934 | struct nlmsghdr *nlh; | 934 | struct nlmsghdr *nlh; |
@@ -1017,7 +1017,7 @@ nla_put_failure: | |||
1017 | - device went down -> we must shutdown all nexthops going via it. | 1017 | - device went down -> we must shutdown all nexthops going via it. |
1018 | */ | 1018 | */ |
1019 | 1019 | ||
1020 | int fib_sync_down(u32 local, struct net_device *dev, int force) | 1020 | int fib_sync_down(__be32 local, struct net_device *dev, int force) |
1021 | { | 1021 | { |
1022 | int ret = 0; | 1022 | int ret = 0; |
1023 | int scope = RT_SCOPE_NOWHERE; | 1023 | int scope = RT_SCOPE_NOWHERE; |