From 6a0ae483145159b0c903690c0313dbc03745c412 Mon Sep 17 00:00:00 2001 From: "/C=EU/ST=EU/CN=Jozsef Kadlecsik/emailAddress=kadlec@blackhole.kfki.hu" Date: Sat, 19 Jul 2008 20:48:19 +0000 Subject: Compatibility cleanup release: kernels >= 2.6.16 and 2.4.36.x are supported. --- kernel/ip_set_macipmap.c | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'kernel/ip_set_macipmap.c') diff --git a/kernel/ip_set_macipmap.c b/kernel/ip_set_macipmap.c index e29c99d..33e2808 100644 --- a/kernel/ip_set_macipmap.c +++ b/kernel/ip_set_macipmap.c @@ -68,13 +68,8 @@ testip_kernel(struct ip_set *set, ip_set_ip_t ip; ip = ntohl(flags[index] & IPSET_SRC -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) ? ip_hdr(skb)->saddr : ip_hdr(skb)->daddr); -#else - ? skb->nh.iph->saddr - : skb->nh.iph->daddr); -#endif if (ip < map->first_ip || ip > map->last_ip) return 0; @@ -86,13 +81,8 @@ testip_kernel(struct ip_set *set, (void *) &table[ip - map->first_ip].flags)) { /* Is mac pointer valid? * If so, compare... */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) return (skb_mac_header(skb) >= skb->head && (skb_mac_header(skb) + ETH_HLEN) <= skb->data -#else - return (skb->mac.raw >= skb->head - && (skb->mac.raw + ETH_HLEN) <= skb->data -#endif && (memcmp(eth_hdr(skb)->h_source, &table[ip - map->first_ip].ethernet, ETH_ALEN) == 0)); @@ -146,21 +136,11 @@ addip_kernel(struct ip_set *set, ip_set_ip_t ip; ip = ntohl(flags[index] & IPSET_SRC -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) ? ip_hdr(skb)->saddr : ip_hdr(skb)->daddr); -#else - ? skb->nh.iph->saddr - : skb->nh.iph->daddr); -#endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) if (!(skb_mac_header(skb) >= skb->head && (skb_mac_header(skb) + ETH_HLEN) <= skb->data)) -#else - if (!(skb->mac.raw >= skb->head - && (skb->mac.raw + ETH_HLEN) <= skb->data)) -#endif return -EINVAL; return __addip(set, ip, eth_hdr(skb)->h_source, hash_ip); @@ -207,13 +187,8 @@ delip_kernel(struct ip_set *set, { return __delip(set, ntohl(flags[index] & IPSET_SRC -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) ? ip_hdr(skb)->saddr : ip_hdr(skb)->daddr), -#else - ? skb->nh.iph->saddr - : skb->nh.iph->daddr), -#endif hash_ip); } -- cgit v1.2.3