X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Fnet%2Fipv6.h;h=ad9a5113025444d77d24fb0721e312c6ac83e9f6;hb=4b805b17382c11a8b1c9bb8053ce9d1dcde0701a;hp=f27fd83d67d8395ad5e30c9131010d73902a43b1;hpb=1da1daed813c534263a87ffc36d5b775e65231ad;p=deliverable%2Flinux.git diff --git a/include/net/ipv6.h b/include/net/ipv6.h index f27fd83d67d8..ad9a51130254 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h @@ -441,6 +441,18 @@ static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_add return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr)); } +static __inline__ void ipv6_select_ident(struct frag_hdr *fhdr) +{ + static u32 ipv6_fragmentation_id = 1; + static DEFINE_SPINLOCK(ip6_id_lock); + + spin_lock_bh(&ip6_id_lock); + fhdr->identification = htonl(ipv6_fragmentation_id); + if (++ipv6_fragmentation_id == 0) + ipv6_fragmentation_id = 1; + spin_unlock_bh(&ip6_id_lock); +} + /* * Prototypes exported by ipv6 */