diff options
Diffstat (limited to 'net/ipv6/sit.c')
-rw-r--r-- | net/ipv6/sit.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index be699f85b2c7..77b7b0911438 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
@@ -60,7 +60,7 @@ | |||
60 | */ | 60 | */ |
61 | 61 | ||
62 | #define HASH_SIZE 16 | 62 | #define HASH_SIZE 16 |
63 | #define HASH(addr) ((addr^(addr>>4))&0xF) | 63 | #define HASH(addr) (((__force u32)addr^((__force u32)addr>>4))&0xF) |
64 | 64 | ||
65 | static int ipip6_fb_tunnel_init(struct net_device *dev); | 65 | static int ipip6_fb_tunnel_init(struct net_device *dev); |
66 | static int ipip6_tunnel_init(struct net_device *dev); | 66 | static int ipip6_tunnel_init(struct net_device *dev); |
@@ -76,7 +76,7 @@ static struct ip_tunnel **tunnels[4] = { tunnels_wc, tunnels_l, tunnels_r, tunne | |||
76 | 76 | ||
77 | static DEFINE_RWLOCK(ipip6_lock); | 77 | static DEFINE_RWLOCK(ipip6_lock); |
78 | 78 | ||
79 | static struct ip_tunnel * ipip6_tunnel_lookup(u32 remote, u32 local) | 79 | static struct ip_tunnel * ipip6_tunnel_lookup(__be32 remote, __be32 local) |
80 | { | 80 | { |
81 | unsigned h0 = HASH(remote); | 81 | unsigned h0 = HASH(remote); |
82 | unsigned h1 = HASH(local); | 82 | unsigned h1 = HASH(local); |
@@ -102,8 +102,8 @@ static struct ip_tunnel * ipip6_tunnel_lookup(u32 remote, u32 local) | |||
102 | 102 | ||
103 | static struct ip_tunnel ** ipip6_bucket(struct ip_tunnel *t) | 103 | static struct ip_tunnel ** ipip6_bucket(struct ip_tunnel *t) |
104 | { | 104 | { |
105 | u32 remote = t->parms.iph.daddr; | 105 | __be32 remote = t->parms.iph.daddr; |
106 | u32 local = t->parms.iph.saddr; | 106 | __be32 local = t->parms.iph.saddr; |
107 | unsigned h = 0; | 107 | unsigned h = 0; |
108 | int prio = 0; | 108 | int prio = 0; |
109 | 109 | ||
@@ -144,8 +144,8 @@ static void ipip6_tunnel_link(struct ip_tunnel *t) | |||
144 | 144 | ||
145 | static struct ip_tunnel * ipip6_tunnel_locate(struct ip_tunnel_parm *parms, int create) | 145 | static struct ip_tunnel * ipip6_tunnel_locate(struct ip_tunnel_parm *parms, int create) |
146 | { | 146 | { |
147 | u32 remote = parms->iph.daddr; | 147 | __be32 remote = parms->iph.daddr; |
148 | u32 local = parms->iph.saddr; | 148 | __be32 local = parms->iph.saddr; |
149 | struct ip_tunnel *t, **tp, *nt; | 149 | struct ip_tunnel *t, **tp, *nt; |
150 | struct net_device *dev; | 150 | struct net_device *dev; |
151 | unsigned h = 0; | 151 | unsigned h = 0; |
@@ -405,9 +405,9 @@ out: | |||
405 | /* Returns the embedded IPv4 address if the IPv6 address | 405 | /* Returns the embedded IPv4 address if the IPv6 address |
406 | comes from 6to4 (RFC 3056) addr space */ | 406 | comes from 6to4 (RFC 3056) addr space */ |
407 | 407 | ||
408 | static inline u32 try_6to4(struct in6_addr *v6dst) | 408 | static inline __be32 try_6to4(struct in6_addr *v6dst) |
409 | { | 409 | { |
410 | u32 dst = 0; | 410 | __be32 dst = 0; |
411 | 411 | ||
412 | if (v6dst->s6_addr16[0] == htons(0x2002)) { | 412 | if (v6dst->s6_addr16[0] == htons(0x2002)) { |
413 | /* 6to4 v6 addr has 16 bits prefix, 32 v4addr, 16 SLA, ... */ | 413 | /* 6to4 v6 addr has 16 bits prefix, 32 v4addr, 16 SLA, ... */ |
@@ -432,7 +432,7 @@ static int ipip6_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) | |||
432 | struct net_device *tdev; /* Device to other host */ | 432 | struct net_device *tdev; /* Device to other host */ |
433 | struct iphdr *iph; /* Our new IP header */ | 433 | struct iphdr *iph; /* Our new IP header */ |
434 | int max_headroom; /* The extra header space needed */ | 434 | int max_headroom; /* The extra header space needed */ |
435 | u32 dst = tiph->daddr; | 435 | __be32 dst = tiph->daddr; |
436 | int mtu; | 436 | int mtu; |
437 | struct in6_addr *addr6; | 437 | struct in6_addr *addr6; |
438 | int addr_type; | 438 | int addr_type; |
@@ -809,7 +809,7 @@ static void __exit sit_destroy_tunnels(void) | |||
809 | } | 809 | } |
810 | } | 810 | } |
811 | 811 | ||
812 | void __exit sit_cleanup(void) | 812 | static void __exit sit_cleanup(void) |
813 | { | 813 | { |
814 | inet_del_protocol(&sit_protocol, IPPROTO_IPV6); | 814 | inet_del_protocol(&sit_protocol, IPPROTO_IPV6); |
815 | 815 | ||
@@ -819,7 +819,7 @@ void __exit sit_cleanup(void) | |||
819 | rtnl_unlock(); | 819 | rtnl_unlock(); |
820 | } | 820 | } |
821 | 821 | ||
822 | int __init sit_init(void) | 822 | static int __init sit_init(void) |
823 | { | 823 | { |
824 | int err; | 824 | int err; |
825 | 825 | ||