diff options
-rw-r--r-- | include/linux/rtnetlink.h | 2 | ||||
-rw-r--r-- | include/net/dst.h | 2 | ||||
-rw-r--r-- | include/net/tcp.h | 3 | ||||
-rw-r--r-- | net/ipv4/syncookies.c | 3 | ||||
-rw-r--r-- | net/ipv4/tcp_output.c | 17 | ||||
-rw-r--r-- | net/ipv6/syncookies.c | 3 |
6 files changed, 21 insertions, 9 deletions
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 05330fc5b436..9590364fe8b5 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -362,6 +362,8 @@ enum { | |||
362 | #define RTAX_FEATURES RTAX_FEATURES | 362 | #define RTAX_FEATURES RTAX_FEATURES |
363 | RTAX_RTO_MIN, | 363 | RTAX_RTO_MIN, |
364 | #define RTAX_RTO_MIN RTAX_RTO_MIN | 364 | #define RTAX_RTO_MIN RTAX_RTO_MIN |
365 | RTAX_INITRWND, | ||
366 | #define RTAX_INITRWND RTAX_INITRWND | ||
365 | __RTAX_MAX | 367 | __RTAX_MAX |
366 | }; | 368 | }; |
367 | 369 | ||
diff --git a/include/net/dst.h b/include/net/dst.h index 39c4a5963e12..ce078cda6b74 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
@@ -83,8 +83,6 @@ struct dst_entry { | |||
83 | * (L1_CACHE_SIZE would be too much) | 83 | * (L1_CACHE_SIZE would be too much) |
84 | */ | 84 | */ |
85 | #ifdef CONFIG_64BIT | 85 | #ifdef CONFIG_64BIT |
86 | long __pad_to_align_refcnt[2]; | ||
87 | #else | ||
88 | long __pad_to_align_refcnt[1]; | 86 | long __pad_to_align_refcnt[1]; |
89 | #endif | 87 | #endif |
90 | /* | 88 | /* |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 185e22baecb1..788c99f98597 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -965,7 +965,8 @@ static inline void tcp_sack_reset(struct tcp_options_received *rx_opt) | |||
965 | /* Determine a window scaling and initial window to offer. */ | 965 | /* Determine a window scaling and initial window to offer. */ |
966 | extern void tcp_select_initial_window(int __space, __u32 mss, | 966 | extern void tcp_select_initial_window(int __space, __u32 mss, |
967 | __u32 *rcv_wnd, __u32 *window_clamp, | 967 | __u32 *rcv_wnd, __u32 *window_clamp, |
968 | int wscale_ok, __u8 *rcv_wscale); | 968 | int wscale_ok, __u8 *rcv_wscale, |
969 | __u32 init_rcv_wnd); | ||
969 | 970 | ||
970 | static inline int tcp_win_from_space(int space) | 971 | static inline int tcp_win_from_space(int space) |
971 | { | 972 | { |
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c index 66fd80ef2473..5c24db4a3c91 100644 --- a/net/ipv4/syncookies.c +++ b/net/ipv4/syncookies.c | |||
@@ -358,7 +358,8 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, | |||
358 | 358 | ||
359 | tcp_select_initial_window(tcp_full_space(sk), req->mss, | 359 | tcp_select_initial_window(tcp_full_space(sk), req->mss, |
360 | &req->rcv_wnd, &req->window_clamp, | 360 | &req->rcv_wnd, &req->window_clamp, |
361 | ireq->wscale_ok, &rcv_wscale); | 361 | ireq->wscale_ok, &rcv_wscale, |
362 | dst_metric(&rt->u.dst, RTAX_INITRWND)); | ||
362 | 363 | ||
363 | ireq->rcv_wscale = rcv_wscale; | 364 | ireq->rcv_wscale = rcv_wscale; |
364 | 365 | ||
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 12b2af36eab8..4a1605d3f909 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -183,7 +183,8 @@ static inline void tcp_event_ack_sent(struct sock *sk, unsigned int pkts) | |||
183 | */ | 183 | */ |
184 | void tcp_select_initial_window(int __space, __u32 mss, | 184 | void tcp_select_initial_window(int __space, __u32 mss, |
185 | __u32 *rcv_wnd, __u32 *window_clamp, | 185 | __u32 *rcv_wnd, __u32 *window_clamp, |
186 | int wscale_ok, __u8 *rcv_wscale) | 186 | int wscale_ok, __u8 *rcv_wscale, |
187 | __u32 init_rcv_wnd) | ||
187 | { | 188 | { |
188 | unsigned int space = (__space < 0 ? 0 : __space); | 189 | unsigned int space = (__space < 0 ? 0 : __space); |
189 | 190 | ||
@@ -232,7 +233,13 @@ void tcp_select_initial_window(int __space, __u32 mss, | |||
232 | init_cwnd = 2; | 233 | init_cwnd = 2; |
233 | else if (mss > 1460) | 234 | else if (mss > 1460) |
234 | init_cwnd = 3; | 235 | init_cwnd = 3; |
235 | if (*rcv_wnd > init_cwnd * mss) | 236 | /* when initializing use the value from init_rcv_wnd |
237 | * rather than the default from above | ||
238 | */ | ||
239 | if (init_rcv_wnd && | ||
240 | (*rcv_wnd > init_rcv_wnd * mss)) | ||
241 | *rcv_wnd = init_rcv_wnd * mss; | ||
242 | else if (*rcv_wnd > init_cwnd * mss) | ||
236 | *rcv_wnd = init_cwnd * mss; | 243 | *rcv_wnd = init_cwnd * mss; |
237 | } | 244 | } |
238 | 245 | ||
@@ -2417,7 +2424,8 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst, | |||
2417 | &req->rcv_wnd, | 2424 | &req->rcv_wnd, |
2418 | &req->window_clamp, | 2425 | &req->window_clamp, |
2419 | ireq->wscale_ok, | 2426 | ireq->wscale_ok, |
2420 | &rcv_wscale); | 2427 | &rcv_wscale, |
2428 | dst_metric(dst, RTAX_INITRWND)); | ||
2421 | ireq->rcv_wscale = rcv_wscale; | 2429 | ireq->rcv_wscale = rcv_wscale; |
2422 | } | 2430 | } |
2423 | 2431 | ||
@@ -2544,7 +2552,8 @@ static void tcp_connect_init(struct sock *sk) | |||
2544 | &tp->rcv_wnd, | 2552 | &tp->rcv_wnd, |
2545 | &tp->window_clamp, | 2553 | &tp->window_clamp, |
2546 | sysctl_tcp_window_scaling, | 2554 | sysctl_tcp_window_scaling, |
2547 | &rcv_wscale); | 2555 | &rcv_wscale, |
2556 | dst_metric(dst, RTAX_INITRWND)); | ||
2548 | 2557 | ||
2549 | tp->rx_opt.rcv_wscale = rcv_wscale; | 2558 | tp->rx_opt.rcv_wscale = rcv_wscale; |
2550 | tp->rcv_ssthresh = tp->rcv_wnd; | 2559 | tp->rcv_ssthresh = tp->rcv_wnd; |
diff --git a/net/ipv6/syncookies.c b/net/ipv6/syncookies.c index 7208a06576c6..34d1f0690d7e 100644 --- a/net/ipv6/syncookies.c +++ b/net/ipv6/syncookies.c | |||
@@ -269,7 +269,8 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) | |||
269 | req->window_clamp = tp->window_clamp ? :dst_metric(dst, RTAX_WINDOW); | 269 | req->window_clamp = tp->window_clamp ? :dst_metric(dst, RTAX_WINDOW); |
270 | tcp_select_initial_window(tcp_full_space(sk), req->mss, | 270 | tcp_select_initial_window(tcp_full_space(sk), req->mss, |
271 | &req->rcv_wnd, &req->window_clamp, | 271 | &req->rcv_wnd, &req->window_clamp, |
272 | ireq->wscale_ok, &rcv_wscale); | 272 | ireq->wscale_ok, &rcv_wscale, |
273 | dst_metric(dst, RTAX_INITRWND)); | ||
273 | 274 | ||
274 | ireq->rcv_wscale = rcv_wscale; | 275 | ireq->rcv_wscale = rcv_wscale; |
275 | 276 | ||