aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sctp/sctp.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/sctp/sctp.h')
-rw-r--r--include/net/sctp/sctp.h24
1 files changed, 3 insertions, 21 deletions
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 8e4de46c052e..f6e7397e799d 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -109,6 +109,7 @@ void sctp_copy_sock(struct sock *newsk, struct sock *sk,
109 struct sctp_association *asoc); 109 struct sctp_association *asoc);
110extern struct percpu_counter sctp_sockets_allocated; 110extern struct percpu_counter sctp_sockets_allocated;
111int sctp_asconf_mgmt(struct sctp_sock *, struct sctp_sockaddr_entry *); 111int sctp_asconf_mgmt(struct sctp_sock *, struct sctp_sockaddr_entry *);
112struct sk_buff *sctp_skb_recv_datagram(struct sock *, int, int, int *);
112 113
113/* 114/*
114 * sctp/primitive.c 115 * sctp/primitive.c
@@ -388,27 +389,6 @@ static inline int sctp_list_single_entry(struct list_head *head)
388 return (head->next != head) && (head->next == head->prev); 389 return (head->next != head) && (head->next == head->prev);
389} 390}
390 391
391/* Generate a random jitter in the range of -50% ~ +50% of input RTO. */
392static inline __s32 sctp_jitter(__u32 rto)
393{
394 static __u32 sctp_rand;
395 __s32 ret;
396
397 /* Avoid divide by zero. */
398 if (!rto)
399 rto = 1;
400
401 sctp_rand += jiffies;
402 sctp_rand ^= (sctp_rand << 12);
403 sctp_rand ^= (sctp_rand >> 20);
404
405 /* Choose random number from 0 to rto, then move to -50% ~ +50%
406 * of rto.
407 */
408 ret = sctp_rand % rto - (rto >> 1);
409 return ret;
410}
411
412/* Break down data chunks at this point. */ 392/* Break down data chunks at this point. */
413static inline int sctp_frag_point(const struct sctp_association *asoc, int pmtu) 393static inline int sctp_frag_point(const struct sctp_association *asoc, int pmtu)
414{ 394{
@@ -574,6 +554,8 @@ static inline void sctp_v6_map_v4(union sctp_addr *addr)
574static inline void sctp_v4_map_v6(union sctp_addr *addr) 554static inline void sctp_v4_map_v6(union sctp_addr *addr)
575{ 555{
576 addr->v6.sin6_family = AF_INET6; 556 addr->v6.sin6_family = AF_INET6;
557 addr->v6.sin6_flowinfo = 0;
558 addr->v6.sin6_scope_id = 0;
577 addr->v6.sin6_port = addr->v4.sin_port; 559 addr->v6.sin6_port = addr->v4.sin_port;
578 addr->v6.sin6_addr.s6_addr32[3] = addr->v4.sin_addr.s_addr; 560 addr->v6.sin6_addr.s6_addr32[3] = addr->v4.sin_addr.s_addr;
579 addr->v6.sin6_addr.s6_addr32[0] = 0; 561 addr->v6.sin6_addr.s6_addr32[0] = 0;