aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ipv6.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/ipv6.h')
-rw-r--r--include/net/ipv6.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index f27fd83d67d8..8c31d8a0c1fe 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
441 return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr)); 441 return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr));
442} 442}
443 443
444static __inline__ void ipv6_select_ident(struct frag_hdr *fhdr)
445{
446 static u32 ipv6_fragmentation_id = 1;
447 static DEFINE_SPINLOCK(ip6_id_lock);
448
449 spin_lock_bh(&ip6_id_lock);
450 fhdr->identification = htonl(ipv6_fragmentation_id);
451 if (++ipv6_fragmentation_id == 0)
452 ipv6_fragmentation_id = 1;
453 spin_unlock_bh(&ip6_id_lock);
454}
455
444/* 456/*
445 * Prototypes exported by ipv6 457 * Prototypes exported by ipv6
446 */ 458 */
@@ -538,7 +550,7 @@ extern int ipv6_find_tlv(struct sk_buff *skb, int offset, int type);
538extern int ipv6_setsockopt(struct sock *sk, int level, 550extern int ipv6_setsockopt(struct sock *sk, int level,
539 int optname, 551 int optname,
540 char __user *optval, 552 char __user *optval,
541 int optlen); 553 unsigned int optlen);
542extern int ipv6_getsockopt(struct sock *sk, int level, 554extern int ipv6_getsockopt(struct sock *sk, int level,
543 int optname, 555 int optname,
544 char __user *optval, 556 char __user *optval,
@@ -547,7 +559,7 @@ extern int compat_ipv6_setsockopt(struct sock *sk,
547 int level, 559 int level,
548 int optname, 560 int optname,
549 char __user *optval, 561 char __user *optval,
550 int optlen); 562 unsigned int optlen);
551extern int compat_ipv6_getsockopt(struct sock *sk, 563extern int compat_ipv6_getsockopt(struct sock *sk,
552 int level, 564 int level,
553 int optname, 565 int optname,