Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 121899
b: refs/heads/master
c: 5bc3eb7
h: refs/heads/master
i:
  121897: 5bf25ab
  121895: 4e3c3ab
v: v3
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Nov 20, 2008
1 parent d5ecf4e commit 0a4cbe9
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 54a30c975b6b27c0c9268461b647576b146d39bb
refs/heads/master: 5bc3eb7e2f0026f246d939851109df99e8e9f64a
25 changes: 17 additions & 8 deletions trunk/net/ipv4/ipmr.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ static void ipmr_del_tunnel(struct net_device *dev, struct vifctl *v)

dev = __dev_get_by_name(&init_net, "tunl0");
if (dev) {
const struct net_device_ops *ops = dev->netdev_ops;
struct ifreq ifr;
mm_segment_t oldfs;
struct ip_tunnel_parm p;

memset(&p, 0, sizeof(p));
Expand All @@ -137,9 +137,13 @@ static void ipmr_del_tunnel(struct net_device *dev, struct vifctl *v)
sprintf(p.name, "dvmrp%d", v->vifc_vifi);
ifr.ifr_ifru.ifru_data = (__force void __user *)&p;

oldfs = get_fs(); set_fs(KERNEL_DS);
dev->do_ioctl(dev, &ifr, SIOCDELTUNNEL);
set_fs(oldfs);
if (ops->ndo_do_ioctl) {
mm_segment_t oldfs = get_fs();

set_fs(KERNEL_DS);
ops->ndo_do_ioctl(dev, &ifr, SIOCDELTUNNEL);
set_fs(oldfs);
}
}
}

Expand All @@ -151,9 +155,9 @@ struct net_device *ipmr_new_tunnel(struct vifctl *v)
dev = __dev_get_by_name(&init_net, "tunl0");

if (dev) {
const struct net_device_ops *ops = dev->netdev_ops;
int err;
struct ifreq ifr;
mm_segment_t oldfs;
struct ip_tunnel_parm p;
struct in_device *in_dev;

Expand All @@ -166,9 +170,14 @@ struct net_device *ipmr_new_tunnel(struct vifctl *v)
sprintf(p.name, "dvmrp%d", v->vifc_vifi);
ifr.ifr_ifru.ifru_data = (__force void __user *)&p;

oldfs = get_fs(); set_fs(KERNEL_DS);
err = dev->do_ioctl(dev, &ifr, SIOCADDTUNNEL);
set_fs(oldfs);
if (ops->ndo_do_ioctl) {
mm_segment_t oldfs = get_fs();

set_fs(KERNEL_DS);
err = ops->ndo_do_ioctl(dev, &ifr, SIOCADDTUNNEL);
set_fs(oldfs);
} else
err = -EOPNOTSUPP;

dev = NULL;

Expand Down
13 changes: 9 additions & 4 deletions trunk/net/ipv6/addrconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -2031,8 +2031,8 @@ int addrconf_set_dstaddr(struct net *net, void __user *arg)

#if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE)
if (dev->type == ARPHRD_SIT) {
const struct net_device_ops *ops = dev->netdev_ops;
struct ifreq ifr;
mm_segment_t oldfs;
struct ip_tunnel_parm p;

err = -EADDRNOTAVAIL;
Expand All @@ -2048,9 +2048,14 @@ int addrconf_set_dstaddr(struct net *net, void __user *arg)
p.iph.ttl = 64;
ifr.ifr_ifru.ifru_data = (__force void __user *)&p;

oldfs = get_fs(); set_fs(KERNEL_DS);
err = dev->do_ioctl(dev, &ifr, SIOCADDTUNNEL);
set_fs(oldfs);
if (ops->ndo_do_ioctl) {
mm_segment_t oldfs = get_fs();

set_fs(KERNEL_DS);
err = ops->ndo_do_ioctl(dev, &ifr, SIOCADDTUNNEL);
set_fs(oldfs);
} else
err = -EOPNOTSUPP;

if (err == 0) {
err = -ENOBUFS;
Expand Down

0 comments on commit 0a4cbe9

Please sign in to comment.