aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
Diffstat (limited to 'include/net')
-rw-r--r--include/net/cls_cgroup.h10
-rw-r--r--include/net/ip_vs.h3
-rw-r--r--include/net/sock.h1
-rw-r--r--include/net/tcp.h18
-rw-r--r--include/net/udp.h1
5 files changed, 29 insertions, 4 deletions
diff --git a/include/net/cls_cgroup.h b/include/net/cls_cgroup.h
index 726cc353640..ef6c24a529e 100644
--- a/include/net/cls_cgroup.h
+++ b/include/net/cls_cgroup.h
@@ -27,11 +27,17 @@ struct cgroup_cls_state
27#ifdef CONFIG_NET_CLS_CGROUP 27#ifdef CONFIG_NET_CLS_CGROUP
28static inline u32 task_cls_classid(struct task_struct *p) 28static inline u32 task_cls_classid(struct task_struct *p)
29{ 29{
30 int classid;
31
30 if (in_interrupt()) 32 if (in_interrupt())
31 return 0; 33 return 0;
32 34
33 return container_of(task_subsys_state(p, net_cls_subsys_id), 35 rcu_read_lock();
34 struct cgroup_cls_state, css)->classid; 36 classid = container_of(task_subsys_state(p, net_cls_subsys_id),
37 struct cgroup_cls_state, css)->classid;
38 rcu_read_unlock();
39
40 return classid;
35} 41}
36#else 42#else
37extern int net_cls_subsys_id; 43extern int net_cls_subsys_id;
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index a4747a0f730..f976885f686 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -955,6 +955,9 @@ static inline __wsum ip_vs_check_diff2(__be16 old, __be16 new, __wsum oldsum)
955 return csum_partial(diff, sizeof(diff), oldsum); 955 return csum_partial(diff, sizeof(diff), oldsum);
956} 956}
957 957
958extern void ip_vs_update_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp,
959 int outin);
960
958#endif /* __KERNEL__ */ 961#endif /* __KERNEL__ */
959 962
960#endif /* _NET_IP_VS_H */ 963#endif /* _NET_IP_VS_H */
diff --git a/include/net/sock.h b/include/net/sock.h
index ac53bfbdfe1..adab9dc5818 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -752,6 +752,7 @@ struct proto {
752 /* Keeping track of sk's, looking them up, and port selection methods. */ 752 /* Keeping track of sk's, looking them up, and port selection methods. */
753 void (*hash)(struct sock *sk); 753 void (*hash)(struct sock *sk);
754 void (*unhash)(struct sock *sk); 754 void (*unhash)(struct sock *sk);
755 void (*rehash)(struct sock *sk);
755 int (*get_port)(struct sock *sk, unsigned short snum); 756 int (*get_port)(struct sock *sk, unsigned short snum);
756 757
757 /* Keeping track of sockets in use */ 758 /* Keeping track of sockets in use */
diff --git a/include/net/tcp.h b/include/net/tcp.h
index eaa9582779d..3e4b33e3660 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -475,8 +475,22 @@ extern unsigned int tcp_current_mss(struct sock *sk);
475/* Bound MSS / TSO packet size with the half of the window */ 475/* Bound MSS / TSO packet size with the half of the window */
476static inline int tcp_bound_to_half_wnd(struct tcp_sock *tp, int pktsize) 476static inline int tcp_bound_to_half_wnd(struct tcp_sock *tp, int pktsize)
477{ 477{
478 if (tp->max_window && pktsize > (tp->max_window >> 1)) 478 int cutoff;
479 return max(tp->max_window >> 1, 68U - tp->tcp_header_len); 479
480 /* When peer uses tiny windows, there is no use in packetizing
481 * to sub-MSS pieces for the sake of SWS or making sure there
482 * are enough packets in the pipe for fast recovery.
483 *
484 * On the other hand, for extremely large MSS devices, handling
485 * smaller than MSS windows in this way does make sense.
486 */
487 if (tp->max_window >= 512)
488 cutoff = (tp->max_window >> 1);
489 else
490 cutoff = tp->max_window;
491
492 if (cutoff && pktsize > cutoff)
493 return max_t(int, cutoff, 68U - tp->tcp_header_len);
480 else 494 else
481 return pktsize; 495 return pktsize;
482} 496}
diff --git a/include/net/udp.h b/include/net/udp.h
index 7abdf305da5..a184d3496b1 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -151,6 +151,7 @@ static inline void udp_lib_hash(struct sock *sk)
151} 151}
152 152
153extern void udp_lib_unhash(struct sock *sk); 153extern void udp_lib_unhash(struct sock *sk);
154extern void udp_lib_rehash(struct sock *sk, u16 new_hash);
154 155
155static inline void udp_lib_close(struct sock *sk, long timeout) 156static inline void udp_lib_close(struct sock *sk, long timeout)
156{ 157{