Revision: 504 http://vde.svn.sourceforge.net/vde/?rev=504&view=rev Author: rd235 Date: 2011-06-28 16:19:40 +0000 (Tue, 28 Jun 2011)
Log Message: ----------- Cleanup: delete of ifdefs for kernels < 2.6.25 Modified Paths: -------------- trunk/ipn/af_ipn.c trunk/ipn/af_ipn.h trunk/ipn/ipn_netdev.c Modified: trunk/ipn/af_ipn.c =================================================================== --- trunk/ipn/af_ipn.c 2011-06-28 16:13:32 UTC (rev 503) +++ trunk/ipn/af_ipn.c 2011-06-28 16:19:40 UTC (rev 504) @@ -41,9 +41,15 @@ MODULE_DESCRIPTION("IPN Kernel Module"); #define IPN_MAX_PROTO 4 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) +#define IPN_PRE2630 +#endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) #define IPN_PRE2632 #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) +#define IPN_PRE2633 +#endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) #define IPN_PRE2637 #endif @@ -295,9 +301,7 @@ /* create a socket * ipn_node is a separate structure, pointed by ipn_sock -> node * when a node is "persistent", ipn_node survives while ipn_sock gets released*/ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) -static int ipn_create(struct socket *sock, int protocol) -#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) +#ifdef IPN_PRE2633 static int ipn_create(struct net *net,struct socket *sock, int protocol) #else static int ipn_create(struct net *net,struct socket *sock, @@ -306,12 +310,8 @@ { struct ipn_sock *ipn_sk; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) - void *net=NULL; -#else if (net != &init_net) return -EAFNOSUPPORT; -#endif if (sock->type != SOCK_RAW) return -EPROTOTYPE; @@ -322,11 +322,7 @@ if (protocol < 0 || protocol >= IPN_MAX_PROTO || ipn_protocol_table[protocol] == NULL) return -EPROTONOSUPPORT; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) - ipn_sk = (struct ipn_sock *) sk_alloc(PF_IPN, GFP_KERNEL, &ipn_proto, 1); -#else ipn_sk = (struct ipn_sock *) sk_alloc(net, PF_IPN, GFP_KERNEL, &ipn_proto); -#endif if (!ipn_sk) return -ENOMEM; @@ -623,7 +619,7 @@ mode = ipn_node->pbp->mode; else mode = SOCK_INODE(sock)->i_mode; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30) +#ifdef IPN_PRE2630 mode = S_IFSOCK | (mode & ~current->fs->umask); #else mode = S_IFSOCK | (mode & ~current_umask()); @@ -849,11 +845,7 @@ struct ipn_network *ipnn; int err=0; int portno; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) - ipn_node=ipn_node_create(NULL); -#else ipn_node=ipn_node_create(&init_net); -#endif if (down_interruptible(&ipn_glob_mutex)) { err=-ERESTARTSYS; goto err_ipn_node_release; @@ -1050,17 +1042,9 @@ up(&ipn_glob_mutex); return -ERESTARTSYS; } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) - dev=__dev_get_by_name(ifr->ifr_name); -#else dev=__dev_get_by_name(ipn_node->net,ifr->ifr_name); -#endif if (!dev) -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) - dev=__dev_get_by_index(ifr->ifr_ifindex); -#else dev=__dev_get_by_index(ipn_node->net,ifr->ifr_ifindex); -#endif if (dev && (ipn_joined=ipn_netdev2node(dev)) != NULL) { /* the interface does exist */ int i; for (i=0;i<ipnn->maxports && ipn_joined != ipnn->connport[i] ;i++) @@ -1091,17 +1075,9 @@ return -EPERM; if (down_interruptible(&ipn_glob_mutex)) return -ERESTARTSYS; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) - dev=__dev_get_by_name(ifr->ifr_name); -#else dev=__dev_get_by_name(&init_net,ifr->ifr_name); -#endif if (!dev) -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) - dev=__dev_get_by_index(ifr->ifr_ifindex); -#else dev=__dev_get_by_index(&init_net,ifr->ifr_ifindex); -#endif if (dev && (ipn_node=ipn_netdev2node(dev)) != NULL) _ipn_setpersist(ipn_node,value); else Modified: trunk/ipn/af_ipn.h =================================================================== --- trunk/ipn/af_ipn.h 2011-06-28 16:13:32 UTC (rev 503) +++ trunk/ipn/af_ipn.h 2011-06-28 16:19:40 UTC (rev 504) @@ -96,9 +96,6 @@ #ifdef __KERNEL__ #include <linux/version.h> -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) -#define kmem_cache_create(A,B,C,D,E) kmem_cache_create((A),(B),(C),(D),(E),(E)) -#endif #include <linux/mutex.h> #include <linux/un.h> Modified: trunk/ipn/ipn_netdev.c =================================================================== --- trunk/ipn/ipn_netdev.c 2011-06-28 16:13:32 UTC (rev 503) +++ trunk/ipn/ipn_netdev.c 2011-06-28 16:19:40 UTC (rev 504) @@ -36,9 +36,6 @@ #define DRV_NAME "ipn" #define DRV_VERSION "0.3.1" -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) -#define IPN_PRE2624 -#endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) #define IPN_PRE2629 #endif @@ -183,11 +180,7 @@ } #endif #endif -#ifdef IPN_PRE2624 - dev=dev_get_by_name(name); -#else dev=dev_get_by_name(net,name); -#endif if (dev) { if (dev->flags & IFF_LOOPBACK) *err= -EINVAL; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2 _______________________________________________ vde-users mailing list vde-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vde-users