~james-page/ubuntu/saucy/openvswitch/1.12-snapshot

« back to all changes in this revision

Viewing changes to datapath/linux/compat/include/net/ipv6.h

  • Committer: James Page
  • Date: 2013-08-21 10:16:57 UTC
  • mfrom: (1.1.20)
  • Revision ID: james.page@canonical.com-20130821101657-3o0z0qeiv5zkwlzi
New upstream snapshot

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
24
24
                         int target, unsigned short *fragoff, int *fragflg);
25
25
 
 
26
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)
 
27
static inline u32 ipv6_addr_hash(const struct in6_addr *a)
 
28
{
 
29
#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64
 
30
        const unsigned long *ul = (const unsigned long *)a;
 
31
        unsigned long x = ul[0] ^ ul[1];
 
32
 
 
33
        return (u32)(x ^ (x >> 32));
 
34
#else
 
35
        return (__force u32)(a->s6_addr32[0] ^ a->s6_addr32[1] ^
 
36
                             a->s6_addr32[2] ^ a->s6_addr32[3]);
 
37
#endif
 
38
}
 
39
#endif
 
40
 
26
41
#endif