git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
net
/
ipv6
/
sit.c
diff --git
a/net/ipv6/sit.c
b/net/ipv6/sit.c
index
c2d3e17
..
77b7b09
100644
(file)
--- a/
net/ipv6/sit.c
+++ b/
net/ipv6/sit.c
@@
-18,7
+18,6
@@
* Nate Thompson <nate@thebog.net>: 6to4 support
*/
* Nate Thompson <nate@thebog.net>: 6to4 support
*/
-#include <linux/config.h>
#include <linux/module.h>
#include <linux/capability.h>
#include <linux/errno.h>
#include <linux/module.h>
#include <linux/capability.h>
#include <linux/errno.h>
@@
-61,7
+60,7
@@
*/
#define HASH_SIZE 16
*/
#define HASH_SIZE 16
-#define HASH(addr) ((
addr^(
addr>>4))&0xF)
+#define HASH(addr) ((
(__force u32)addr^((__force u32)
addr>>4))&0xF)
static int ipip6_fb_tunnel_init(struct net_device *dev);
static int ipip6_tunnel_init(struct net_device *dev);
static int ipip6_fb_tunnel_init(struct net_device *dev);
static int ipip6_tunnel_init(struct net_device *dev);
@@
-77,7
+76,7
@@
static struct ip_tunnel **tunnels[4] = { tunnels_wc, tunnels_l, tunnels_r, tunne
static DEFINE_RWLOCK(ipip6_lock);
static DEFINE_RWLOCK(ipip6_lock);
-static struct ip_tunnel * ipip6_tunnel_lookup(
u32 remote, u
32 local)
+static struct ip_tunnel * ipip6_tunnel_lookup(
__be32 remote, __be
32 local)
{
unsigned h0 = HASH(remote);
unsigned h1 = HASH(local);
{
unsigned h0 = HASH(remote);
unsigned h1 = HASH(local);
@@
-103,8
+102,8
@@
static struct ip_tunnel * ipip6_tunnel_lookup(u32 remote, u32 local)
static struct ip_tunnel ** ipip6_bucket(struct ip_tunnel *t)
{
static struct ip_tunnel ** ipip6_bucket(struct ip_tunnel *t)
{
-
u
32 remote = t->parms.iph.daddr;
-
u
32 local = t->parms.iph.saddr;
+
__be
32 remote = t->parms.iph.daddr;
+
__be
32 local = t->parms.iph.saddr;
unsigned h = 0;
int prio = 0;
unsigned h = 0;
int prio = 0;
@@
-145,8
+144,8
@@
static void ipip6_tunnel_link(struct ip_tunnel *t)
static struct ip_tunnel * ipip6_tunnel_locate(struct ip_tunnel_parm *parms, int create)
{
static struct ip_tunnel * ipip6_tunnel_locate(struct ip_tunnel_parm *parms, int create)
{
-
u
32 remote = parms->iph.daddr;
-
u
32 local = parms->iph.saddr;
+
__be
32 remote = parms->iph.daddr;
+
__be
32 local = parms->iph.saddr;
struct ip_tunnel *t, **tp, *nt;
struct net_device *dev;
unsigned h = 0;
struct ip_tunnel *t, **tp, *nt;
struct net_device *dev;
unsigned h = 0;
@@
-381,7
+380,6
@@
static int ipip6_rcv(struct sk_buff *skb)
secpath_reset(skb);
skb->mac.raw = skb->nh.raw;
skb->nh.raw = skb->data;
secpath_reset(skb);
skb->mac.raw = skb->nh.raw;
skb->nh.raw = skb->data;
- memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
IPCB(skb)->flags = 0;
skb->protocol = htons(ETH_P_IPV6);
skb->pkt_type = PACKET_HOST;
IPCB(skb)->flags = 0;
skb->protocol = htons(ETH_P_IPV6);
skb->pkt_type = PACKET_HOST;
@@
-397,7
+395,7
@@
static int ipip6_rcv(struct sk_buff *skb)
return 0;
}
return 0;
}
- icmp_send(skb, ICMP_DEST_UNREACH, ICMP_P
RO
T_UNREACH, 0);
+ icmp_send(skb, ICMP_DEST_UNREACH, ICMP_P
OR
T_UNREACH, 0);
kfree_skb(skb);
read_unlock(&ipip6_lock);
out:
kfree_skb(skb);
read_unlock(&ipip6_lock);
out:
@@
-407,9
+405,9
@@
out:
/* Returns the embedded IPv4 address if the IPv6 address
comes from 6to4 (RFC 3056) addr space */
/* Returns the embedded IPv4 address if the IPv6 address
comes from 6to4 (RFC 3056) addr space */
-static inline
u
32 try_6to4(struct in6_addr *v6dst)
+static inline
__be
32 try_6to4(struct in6_addr *v6dst)
{
{
-
u
32 dst = 0;
+
__be
32 dst = 0;
if (v6dst->s6_addr16[0] == htons(0x2002)) {
/* 6to4 v6 addr has 16 bits prefix, 32 v4addr, 16 SLA, ... */
if (v6dst->s6_addr16[0] == htons(0x2002)) {
/* 6to4 v6 addr has 16 bits prefix, 32 v4addr, 16 SLA, ... */
@@
-434,7
+432,7
@@
static int ipip6_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
struct net_device *tdev; /* Device to other host */
struct iphdr *iph; /* Our new IP header */
int max_headroom; /* The extra header space needed */
struct net_device *tdev; /* Device to other host */
struct iphdr *iph; /* Our new IP header */
int max_headroom; /* The extra header space needed */
-
u32
dst = tiph->daddr;
+
__be32
dst = tiph->daddr;
int mtu;
struct in6_addr *addr6;
int addr_type;
int mtu;
struct in6_addr *addr6;
int addr_type;
@@
-811,7
+809,7
@@
static void __exit sit_destroy_tunnels(void)
}
}
}
}
-void __exit sit_cleanup(void)
+
static
void __exit sit_cleanup(void)
{
inet_del_protocol(&sit_protocol, IPPROTO_IPV6);
{
inet_del_protocol(&sit_protocol, IPPROTO_IPV6);
@@
-821,7
+819,7
@@
void __exit sit_cleanup(void)
rtnl_unlock();
}
rtnl_unlock();
}
-int __init sit_init(void)
+
static
int __init sit_init(void)
{
int err;
{
int err;
@@
-852,3
+850,8
@@
int __init sit_init(void)
inet_del_protocol(&sit_protocol, IPPROTO_IPV6);
goto out;
}
inet_del_protocol(&sit_protocol, IPPROTO_IPV6);
goto out;
}
+
+module_init(sit_init);
+module_exit(sit_cleanup);
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("sit0");