1 diff -Nurb linux-2.6.22-593/net/core/net-sysfs.c linux-2.6.22-594/net/core/net-sysfs.c
2 --- linux-2.6.22-593/net/core/net-sysfs.c 2008-02-29 09:01:43.000000000 -0500
3 +++ linux-2.6.22-594/net/core/net-sysfs.c 2008-02-29 09:20:20.000000000 -0500
5 return netdev_store(device, attr, buf, len, change_mtu);
8 +static ssize_t show_new_ns_pid(struct device *cd, struct device_attribute *attr, char *buf)
13 +static int change_new_ns_pid(struct net_device *dev, unsigned long new_ns_pid)
15 + struct task_struct *tsk;
18 + /* Look up the network namespace */
21 + tsk = find_task_by_real_pid(new_ns_pid);
26 + net = get_net(tsk->nsproxy->net_ns);
31 + /* If I found a network namespace move the device */
33 + err = dev_change_net_namespace(dev, net, NULL);
38 +static ssize_t store_new_ns_pid(struct device *cd, struct device_attribute *attr, const char *buf, size_t len)
40 + return netdev_store(cd, attr, buf, len, change_new_ns_pid);
43 NETDEVICE_SHOW(flags, fmt_hex);
45 static int change_flags(struct net_device *dev, unsigned long new_flags)
47 __ATTR(tx_queue_len, S_IRUGO | S_IWUSR, show_tx_queue_len,
49 __ATTR(weight, S_IRUGO | S_IWUSR, show_weight, store_weight),
50 + __ATTR(new_ns_pid, S_IWUSR, show_new_ns_pid, store_new_ns_pid),