build: support for Linux 3.2

This commit is contained in:
Jan Engelhardt
2011-12-31 02:15:45 +01:00
parent 36df60c940
commit 31fdd86247
8 changed files with 32 additions and 16 deletions

View File

@@ -12,6 +12,7 @@
#include <linux/icmp.h>
#include <linux/icmpv6.h>
#include <linux/sctp.h>
#include <linux/version.h>
#include <linux/netfilter_ipv6/ip6_tables.h>
#include <net/ip.h>
#include <net/ipv6.h>
@@ -115,9 +116,14 @@ ip_set_get_ip6_port(const struct sk_buff *skb, bool src,
{
int protoff;
u8 nexthdr;
__be16 frag_off;
nexthdr = ipv6_hdr(skb)->nexthdr;
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)
protoff = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &nexthdr);
#else
protoff = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &nexthdr, &frag_off);
#endif
if (protoff < 0)
return false;

View File

@@ -241,7 +241,7 @@ hash_ip6_data_isnull(const struct hash_ip6_elem *elem)
static inline void
hash_ip6_data_copy(struct hash_ip6_elem *dst, const struct hash_ip6_elem *src)
{
ipv6_addr_copy(&dst->ip.in6, &src->ip.in6);
dst->ip.in6 = src->ip.in6;
}
static inline void

View File

@@ -267,7 +267,7 @@ static inline void
hash_net6_data_copy(struct hash_net6_elem *dst,
const struct hash_net6_elem *src)
{
ipv6_addr_copy(&dst->ip.in6, &src->ip.in6);
dst->ip.in6 = src->ip.in6;
dst->cidr = src->cidr;
}