2 * Copyright 2010 Hauke Mehrtens <hauke@hauke-m.de>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
8 * Compatibility file for Linux wireless for kernels 2.6.37.
11 #include <linux/compat.h>
13 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
15 #include <linux/netdevice.h>
17 #include <linux/nsproxy.h>
19 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)
20 static const void *net_current_ns(void)
22 return current->nsproxy->net_ns;
25 static const void *net_initial_ns(void)
30 static const void *net_netlink_ns(struct sock *sk)
35 struct kobj_ns_type_operations net_ns_type_operations = {
36 .type = KOBJ_NS_TYPE_NET,
37 .current_ns = net_current_ns,
38 .netlink_ns = net_netlink_ns,
39 .initial_ns = net_initial_ns,
41 EXPORT_SYMBOL_GPL(net_ns_type_operations);
43 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)*/
45 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) */