projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Pull sn2-mmio-writes into release branch
[powerpc.git]
/
net
/
ipv6
/
ip6_tunnel.c
diff --git
a/net/ipv6/ip6_tunnel.c
b/net/ipv6/ip6_tunnel.c
index
cf94372
..
4859753
100644
(file)
--- a/
net/ipv6/ip6_tunnel.c
+++ b/
net/ipv6/ip6_tunnel.c
@@
-21,6
+21,7
@@
#include <linux/config.h>
#include <linux/module.h>
#include <linux/config.h>
#include <linux/module.h>
+#include <linux/capability.h>
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/sockios.h>
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/sockios.h>
@@
-243,7
+244,7
@@
ip6_tnl_create(struct ip6_tnl_parm *p, struct ip6_tnl **pt)
if (dev == NULL)
return -ENOMEM;
if (dev == NULL)
return -ENOMEM;
- t =
dev->priv
;
+ t =
netdev_priv(dev)
;
dev->init = ip6ip6_tnl_dev_init;
t->parms = *p;
dev->init = ip6ip6_tnl_dev_init;
t->parms = *p;
@@
-308,7
+309,7
@@
ip6ip6_tnl_locate(struct ip6_tnl_parm *p, struct ip6_tnl **pt, int create)
static void
ip6ip6_tnl_dev_uninit(struct net_device *dev)
{
static void
ip6ip6_tnl_dev_uninit(struct net_device *dev)
{
- struct ip6_tnl *t =
dev->priv
;
+ struct ip6_tnl *t =
netdev_priv(dev)
;
if (dev == ip6ip6_fb_tnl_dev) {
write_lock_bh(&ip6ip6_lock);
if (dev == ip6ip6_fb_tnl_dev) {
write_lock_bh(&ip6ip6_lock);
@@
-457,7
+458,7
@@
ip6ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
mtu = IPV6_MIN_MTU;
t->dev->mtu = mtu;
mtu = IPV6_MIN_MTU;
t->dev->mtu = mtu;
- if ((len = sizeof (*ipv6h) +
ipv6h->payload_len
) > mtu) {
+ if ((len = sizeof (*ipv6h) +
ntohs(ipv6h->payload_len)
) > mtu) {
rel_type = ICMPV6_PKT_TOOBIG;
rel_code = 0;
rel_info = mtu;
rel_type = ICMPV6_PKT_TOOBIG;
rel_code = 0;
rel_info = mtu;
@@
-510,7
+511,7
@@
static inline void ip6ip6_ecn_decapsulate(struct ipv6hdr *outer_iph,
**/
static int
**/
static int
-ip6ip6_rcv(struct sk_buff **pskb
, unsigned int *nhoffp
)
+ip6ip6_rcv(struct sk_buff **pskb)
{
struct sk_buff *skb = *pskb;
struct ipv6hdr *ipv6h;
{
struct sk_buff *skb = *pskb;
struct ipv6hdr *ipv6h;
@@
-525,6
+526,7
@@
ip6ip6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
if ((t = ip6ip6_tnl_lookup(&ipv6h->saddr, &ipv6h->daddr)) != NULL) {
if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) {
if ((t = ip6ip6_tnl_lookup(&ipv6h->saddr, &ipv6h->daddr)) != NULL) {
if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) {
+ read_unlock(&ip6ip6_lock);
kfree_skb(skb);
return 0;
}
kfree_skb(skb);
return 0;
}
@@
-622,7
+624,7
@@
ip6ip6_tnl_addr_conflict(struct ip6_tnl *t, struct ipv6hdr *hdr)
static int
ip6ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev)
{
static int
ip6ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev)
{
- struct ip6_tnl *t =
(struct ip6_tnl *) dev->priv
;
+ struct ip6_tnl *t =
netdev_priv(dev)
;
struct net_device_stats *stats = &t->stat;
struct ipv6hdr *ipv6h = skb->nh.ipv6h;
struct ipv6_txoptions *opt = NULL;
struct net_device_stats *stats = &t->stat;
struct ipv6hdr *ipv6h = skb->nh.ipv6h;
struct ipv6_txoptions *opt = NULL;
@@
-756,8
+758,7
@@
ip6ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev)
}
ip6_tnl_dst_store(t, dst);
}
ip6_tnl_dst_store(t, dst);
- if (opt)
- kfree(opt);
+ kfree(opt);
t->recursion--;
return 0;
t->recursion--;
return 0;
@@
-766,8
+767,7
@@
tx_err_link_failure:
dst_link_failure(skb);
tx_err_dst_release:
dst_release(dst);
dst_link_failure(skb);
tx_err_dst_release:
dst_release(dst);
- if (opt)
- kfree(opt);
+ kfree(opt);
tx_err:
stats->tx_errors++;
stats->tx_dropped++;
tx_err:
stats->tx_errors++;
stats->tx_dropped++;
@@
-884,6
+884,7
@@
ip6ip6_tnl_change(struct ip6_tnl *t, struct ip6_tnl_parm *p)
t->parms.encap_limit = p->encap_limit;
t->parms.flowinfo = p->flowinfo;
t->parms.link = p->link;
t->parms.encap_limit = p->encap_limit;
t->parms.flowinfo = p->flowinfo;
t->parms.link = p->link;
+ ip6_tnl_dst_reset(t);
ip6ip6_tnl_link_config(t);
return 0;
}
ip6ip6_tnl_link_config(t);
return 0;
}
@@
-934,11
+935,11
@@
ip6ip6_tnl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
break;
}
if ((err = ip6ip6_tnl_locate(&p, &t, 0)) == -ENODEV)
break;
}
if ((err = ip6ip6_tnl_locate(&p, &t, 0)) == -ENODEV)
- t =
(struct ip6_tnl *) dev->priv
;
+ t =
netdev_priv(dev)
;
else if (err)
break;
} else
else if (err)
break;
} else
- t =
(struct ip6_tnl *) dev->priv
;
+ t =
netdev_priv(dev)
;
memcpy(&p, &t->parms, sizeof (p));
if (copy_to_user(ifr->ifr_ifru.ifru_data, &p, sizeof (p))) {
memcpy(&p, &t->parms, sizeof (p));
if (copy_to_user(ifr->ifr_ifru.ifru_data, &p, sizeof (p))) {
@@
-956,7
+957,7
@@
ip6ip6_tnl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
break;
}
if (!create && dev != ip6ip6_fb_tnl_dev) {
break;
}
if (!create && dev != ip6ip6_fb_tnl_dev) {
- t =
(struct ip6_tnl *) dev->priv
;
+ t =
netdev_priv(dev)
;
}
if (!t && (err = ip6ip6_tnl_locate(&p, &t, create))) {
break;
}
if (!t && (err = ip6ip6_tnl_locate(&p, &t, create))) {
break;
@@
-992,12
+993,12
@@
ip6ip6_tnl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
err = ip6ip6_tnl_locate(&p, &t, 0);
if (err)
break;
err = ip6ip6_tnl_locate(&p, &t, 0);
if (err)
break;
- if (t ==
ip6ip6_fb_tnl_dev->priv
) {
+ if (t ==
netdev_priv(ip6ip6_fb_tnl_dev)
) {
err = -EPERM;
break;
}
} else {
err = -EPERM;
break;
}
} else {
- t =
(struct ip6_tnl *) dev->priv
;
+ t =
netdev_priv(dev)
;
}
err = unregister_netdevice(t->dev);
break;
}
err = unregister_netdevice(t->dev);
break;
@@
-1017,7
+1018,7
@@
ip6ip6_tnl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
static struct net_device_stats *
ip6ip6_tnl_get_stats(struct net_device *dev)
{
static struct net_device_stats *
ip6ip6_tnl_get_stats(struct net_device *dev)
{
- return &(((struct ip6_tnl *)
dev->priv
)->stat);
+ return &(((struct ip6_tnl *)
netdev_priv(dev)
)->stat);
}
/**
}
/**
@@
-1074,7
+1075,7
@@
static void ip6ip6_tnl_dev_setup(struct net_device *dev)
static inline void
ip6ip6_tnl_dev_init_gen(struct net_device *dev)
{
static inline void
ip6ip6_tnl_dev_init_gen(struct net_device *dev)
{
- struct ip6_tnl *t =
(struct ip6_tnl *) dev->priv
;
+ struct ip6_tnl *t =
netdev_priv(dev)
;
t->fl.proto = IPPROTO_IPV6;
t->dev = dev;
strcpy(t->parms.name, dev->name);
t->fl.proto = IPPROTO_IPV6;
t->dev = dev;
strcpy(t->parms.name, dev->name);
@@
-1088,7
+1089,7
@@
ip6ip6_tnl_dev_init_gen(struct net_device *dev)
static int
ip6ip6_tnl_dev_init(struct net_device *dev)
{
static int
ip6ip6_tnl_dev_init(struct net_device *dev)
{
- struct ip6_tnl *t =
(struct ip6_tnl *) dev->priv
;
+ struct ip6_tnl *t =
netdev_priv(dev)
;
ip6ip6_tnl_dev_init_gen(dev);
ip6ip6_tnl_link_config(t);
return 0;
ip6ip6_tnl_dev_init_gen(dev);
ip6ip6_tnl_link_config(t);
return 0;
@@
-1104,7
+1105,7
@@
ip6ip6_tnl_dev_init(struct net_device *dev)
static int
ip6ip6_fb_tnl_dev_init(struct net_device *dev)
{
static int
ip6ip6_fb_tnl_dev_init(struct net_device *dev)
{
- struct ip6_tnl *t =
dev->priv
;
+ struct ip6_tnl *t =
netdev_priv(dev)
;
ip6ip6_tnl_dev_init_gen(dev);
dev_hold(dev);
tnls_wc[0] = t;
ip6ip6_tnl_dev_init_gen(dev);
dev_hold(dev);
tnls_wc[0] = t;