diff options
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r-- | net/ipv4/tcp_input.c | 110 |
1 files changed, 56 insertions, 54 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 69a90b839984..52b5c2d0ecd0 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -206,7 +206,7 @@ static inline void TCP_ECN_queue_cwr(struct tcp_sock *tp) | |||
206 | tp->ecn_flags |= TCP_ECN_QUEUE_CWR; | 206 | tp->ecn_flags |= TCP_ECN_QUEUE_CWR; |
207 | } | 207 | } |
208 | 208 | ||
209 | static inline void TCP_ECN_accept_cwr(struct tcp_sock *tp, struct sk_buff *skb) | 209 | static inline void TCP_ECN_accept_cwr(struct tcp_sock *tp, const struct sk_buff *skb) |
210 | { | 210 | { |
211 | if (tcp_hdr(skb)->cwr) | 211 | if (tcp_hdr(skb)->cwr) |
212 | tp->ecn_flags &= ~TCP_ECN_DEMAND_CWR; | 212 | tp->ecn_flags &= ~TCP_ECN_DEMAND_CWR; |
@@ -239,19 +239,19 @@ static inline void TCP_ECN_check_ce(struct tcp_sock *tp, const struct sk_buff *s | |||
239 | } | 239 | } |
240 | } | 240 | } |
241 | 241 | ||
242 | static inline void TCP_ECN_rcv_synack(struct tcp_sock *tp, struct tcphdr *th) | 242 | static inline void TCP_ECN_rcv_synack(struct tcp_sock *tp, const struct tcphdr *th) |
243 | { | 243 | { |
244 | if ((tp->ecn_flags & TCP_ECN_OK) && (!th->ece || th->cwr)) | 244 | if ((tp->ecn_flags & TCP_ECN_OK) && (!th->ece || th->cwr)) |
245 | tp->ecn_flags &= ~TCP_ECN_OK; | 245 | tp->ecn_flags &= ~TCP_ECN_OK; |
246 | } | 246 | } |
247 | 247 | ||
248 | static inline void TCP_ECN_rcv_syn(struct tcp_sock *tp, struct tcphdr *th) | 248 | static inline void TCP_ECN_rcv_syn(struct tcp_sock *tp, const struct tcphdr *th) |
249 | { | 249 | { |
250 | if ((tp->ecn_flags & TCP_ECN_OK) && (!th->ece || !th->cwr)) | 250 | if ((tp->ecn_flags & TCP_ECN_OK) && (!th->ece || !th->cwr)) |
251 | tp->ecn_flags &= ~TCP_ECN_OK; | 251 | tp->ecn_flags &= ~TCP_ECN_OK; |
252 | } | 252 | } |
253 | 253 | ||
254 | static inline int TCP_ECN_rcv_ecn_echo(struct tcp_sock *tp, struct tcphdr *th) | 254 | static inline int TCP_ECN_rcv_ecn_echo(const struct tcp_sock *tp, const struct tcphdr *th) |
255 | { | 255 | { |
256 | if (th->ece && !th->syn && (tp->ecn_flags & TCP_ECN_OK)) | 256 | if (th->ece && !th->syn && (tp->ecn_flags & TCP_ECN_OK)) |
257 | return 1; | 257 | return 1; |
@@ -315,7 +315,7 @@ static int __tcp_grow_window(const struct sock *sk, const struct sk_buff *skb) | |||
315 | return 0; | 315 | return 0; |
316 | } | 316 | } |
317 | 317 | ||
318 | static void tcp_grow_window(struct sock *sk, struct sk_buff *skb) | 318 | static void tcp_grow_window(struct sock *sk, const struct sk_buff *skb) |
319 | { | 319 | { |
320 | struct tcp_sock *tp = tcp_sk(sk); | 320 | struct tcp_sock *tp = tcp_sk(sk); |
321 | 321 | ||
@@ -429,7 +429,7 @@ static void tcp_clamp_window(struct sock *sk) | |||
429 | */ | 429 | */ |
430 | void tcp_initialize_rcv_mss(struct sock *sk) | 430 | void tcp_initialize_rcv_mss(struct sock *sk) |
431 | { | 431 | { |
432 | struct tcp_sock *tp = tcp_sk(sk); | 432 | const struct tcp_sock *tp = tcp_sk(sk); |
433 | unsigned int hint = min_t(unsigned int, tp->advmss, tp->mss_cache); | 433 | unsigned int hint = min_t(unsigned int, tp->advmss, tp->mss_cache); |
434 | 434 | ||
435 | hint = min(hint, tp->rcv_wnd / 2); | 435 | hint = min(hint, tp->rcv_wnd / 2); |
@@ -824,7 +824,7 @@ void tcp_update_metrics(struct sock *sk) | |||
824 | } | 824 | } |
825 | } | 825 | } |
826 | 826 | ||
827 | __u32 tcp_init_cwnd(struct tcp_sock *tp, struct dst_entry *dst) | 827 | __u32 tcp_init_cwnd(const struct tcp_sock *tp, const struct dst_entry *dst) |
828 | { | 828 | { |
829 | __u32 cwnd = (dst ? dst_metric(dst, RTAX_INITCWND) : 0); | 829 | __u32 cwnd = (dst ? dst_metric(dst, RTAX_INITCWND) : 0); |
830 | 830 | ||
@@ -1216,7 +1216,7 @@ static void tcp_mark_lost_retrans(struct sock *sk) | |||
1216 | tp->lost_retrans_low = new_low_seq; | 1216 | tp->lost_retrans_low = new_low_seq; |
1217 | } | 1217 | } |
1218 | 1218 | ||
1219 | static int tcp_check_dsack(struct sock *sk, struct sk_buff *ack_skb, | 1219 | static int tcp_check_dsack(struct sock *sk, const struct sk_buff *ack_skb, |
1220 | struct tcp_sack_block_wire *sp, int num_sacks, | 1220 | struct tcp_sack_block_wire *sp, int num_sacks, |
1221 | u32 prior_snd_una) | 1221 | u32 prior_snd_una) |
1222 | { | 1222 | { |
@@ -1310,7 +1310,7 @@ static int tcp_match_skb_to_sack(struct sock *sk, struct sk_buff *skb, | |||
1310 | return in_sack; | 1310 | return in_sack; |
1311 | } | 1311 | } |
1312 | 1312 | ||
1313 | static u8 tcp_sacktag_one(struct sk_buff *skb, struct sock *sk, | 1313 | static u8 tcp_sacktag_one(const struct sk_buff *skb, struct sock *sk, |
1314 | struct tcp_sacktag_state *state, | 1314 | struct tcp_sacktag_state *state, |
1315 | int dup_sack, int pcount) | 1315 | int dup_sack, int pcount) |
1316 | { | 1316 | { |
@@ -1465,13 +1465,13 @@ static int tcp_shifted_skb(struct sock *sk, struct sk_buff *skb, | |||
1465 | /* I wish gso_size would have a bit more sane initialization than | 1465 | /* I wish gso_size would have a bit more sane initialization than |
1466 | * something-or-zero which complicates things | 1466 | * something-or-zero which complicates things |
1467 | */ | 1467 | */ |
1468 | static int tcp_skb_seglen(struct sk_buff *skb) | 1468 | static int tcp_skb_seglen(const struct sk_buff *skb) |
1469 | { | 1469 | { |
1470 | return tcp_skb_pcount(skb) == 1 ? skb->len : tcp_skb_mss(skb); | 1470 | return tcp_skb_pcount(skb) == 1 ? skb->len : tcp_skb_mss(skb); |
1471 | } | 1471 | } |
1472 | 1472 | ||
1473 | /* Shifting pages past head area doesn't work */ | 1473 | /* Shifting pages past head area doesn't work */ |
1474 | static int skb_can_shift(struct sk_buff *skb) | 1474 | static int skb_can_shift(const struct sk_buff *skb) |
1475 | { | 1475 | { |
1476 | return !skb_headlen(skb) && skb_is_nonlinear(skb); | 1476 | return !skb_headlen(skb) && skb_is_nonlinear(skb); |
1477 | } | 1477 | } |
@@ -1720,19 +1720,19 @@ static struct sk_buff *tcp_maybe_skipping_dsack(struct sk_buff *skb, | |||
1720 | return skb; | 1720 | return skb; |
1721 | } | 1721 | } |
1722 | 1722 | ||
1723 | static int tcp_sack_cache_ok(struct tcp_sock *tp, struct tcp_sack_block *cache) | 1723 | static int tcp_sack_cache_ok(const struct tcp_sock *tp, const struct tcp_sack_block *cache) |
1724 | { | 1724 | { |
1725 | return cache < tp->recv_sack_cache + ARRAY_SIZE(tp->recv_sack_cache); | 1725 | return cache < tp->recv_sack_cache + ARRAY_SIZE(tp->recv_sack_cache); |
1726 | } | 1726 | } |
1727 | 1727 | ||
1728 | static int | 1728 | static int |
1729 | tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, | 1729 | tcp_sacktag_write_queue(struct sock *sk, const struct sk_buff *ack_skb, |
1730 | u32 prior_snd_una) | 1730 | u32 prior_snd_una) |
1731 | { | 1731 | { |
1732 | const struct inet_connection_sock *icsk = inet_csk(sk); | 1732 | const struct inet_connection_sock *icsk = inet_csk(sk); |
1733 | struct tcp_sock *tp = tcp_sk(sk); | 1733 | struct tcp_sock *tp = tcp_sk(sk); |
1734 | unsigned char *ptr = (skb_transport_header(ack_skb) + | 1734 | const unsigned char *ptr = (skb_transport_header(ack_skb) + |
1735 | TCP_SKB_CB(ack_skb)->sacked); | 1735 | TCP_SKB_CB(ack_skb)->sacked); |
1736 | struct tcp_sack_block_wire *sp_wire = (struct tcp_sack_block_wire *)(ptr+2); | 1736 | struct tcp_sack_block_wire *sp_wire = (struct tcp_sack_block_wire *)(ptr+2); |
1737 | struct tcp_sack_block sp[TCP_NUM_SACKS]; | 1737 | struct tcp_sack_block sp[TCP_NUM_SACKS]; |
1738 | struct tcp_sack_block *cache; | 1738 | struct tcp_sack_block *cache; |
@@ -2296,7 +2296,7 @@ static int tcp_check_sack_reneging(struct sock *sk, int flag) | |||
2296 | return 0; | 2296 | return 0; |
2297 | } | 2297 | } |
2298 | 2298 | ||
2299 | static inline int tcp_fackets_out(struct tcp_sock *tp) | 2299 | static inline int tcp_fackets_out(const struct tcp_sock *tp) |
2300 | { | 2300 | { |
2301 | return tcp_is_reno(tp) ? tp->sacked_out + 1 : tp->fackets_out; | 2301 | return tcp_is_reno(tp) ? tp->sacked_out + 1 : tp->fackets_out; |
2302 | } | 2302 | } |
@@ -2316,19 +2316,20 @@ static inline int tcp_fackets_out(struct tcp_sock *tp) | |||
2316 | * they differ. Since neither occurs due to loss, TCP should really | 2316 | * they differ. Since neither occurs due to loss, TCP should really |
2317 | * ignore them. | 2317 | * ignore them. |
2318 | */ | 2318 | */ |
2319 | static inline int tcp_dupack_heuristics(struct tcp_sock *tp) | 2319 | static inline int tcp_dupack_heuristics(const struct tcp_sock *tp) |
2320 | { | 2320 | { |
2321 | return tcp_is_fack(tp) ? tp->fackets_out : tp->sacked_out + 1; | 2321 | return tcp_is_fack(tp) ? tp->fackets_out : tp->sacked_out + 1; |
2322 | } | 2322 | } |
2323 | 2323 | ||
2324 | static inline int tcp_skb_timedout(struct sock *sk, struct sk_buff *skb) | 2324 | static inline int tcp_skb_timedout(const struct sock *sk, |
2325 | const struct sk_buff *skb) | ||
2325 | { | 2326 | { |
2326 | return tcp_time_stamp - TCP_SKB_CB(skb)->when > inet_csk(sk)->icsk_rto; | 2327 | return tcp_time_stamp - TCP_SKB_CB(skb)->when > inet_csk(sk)->icsk_rto; |
2327 | } | 2328 | } |
2328 | 2329 | ||
2329 | static inline int tcp_head_timedout(struct sock *sk) | 2330 | static inline int tcp_head_timedout(const struct sock *sk) |
2330 | { | 2331 | { |
2331 | struct tcp_sock *tp = tcp_sk(sk); | 2332 | const struct tcp_sock *tp = tcp_sk(sk); |
2332 | 2333 | ||
2333 | return tp->packets_out && | 2334 | return tp->packets_out && |
2334 | tcp_skb_timedout(sk, tcp_write_queue_head(sk)); | 2335 | tcp_skb_timedout(sk, tcp_write_queue_head(sk)); |
@@ -2639,7 +2640,7 @@ static void tcp_cwnd_down(struct sock *sk, int flag) | |||
2639 | /* Nothing was retransmitted or returned timestamp is less | 2640 | /* Nothing was retransmitted or returned timestamp is less |
2640 | * than timestamp of the first retransmission. | 2641 | * than timestamp of the first retransmission. |
2641 | */ | 2642 | */ |
2642 | static inline int tcp_packet_delayed(struct tcp_sock *tp) | 2643 | static inline int tcp_packet_delayed(const struct tcp_sock *tp) |
2643 | { | 2644 | { |
2644 | return !tp->retrans_stamp || | 2645 | return !tp->retrans_stamp || |
2645 | (tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr && | 2646 | (tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr && |
@@ -2700,7 +2701,7 @@ static void tcp_undo_cwr(struct sock *sk, const bool undo_ssthresh) | |||
2700 | tp->snd_cwnd_stamp = tcp_time_stamp; | 2701 | tp->snd_cwnd_stamp = tcp_time_stamp; |
2701 | } | 2702 | } |
2702 | 2703 | ||
2703 | static inline int tcp_may_undo(struct tcp_sock *tp) | 2704 | static inline int tcp_may_undo(const struct tcp_sock *tp) |
2704 | { | 2705 | { |
2705 | return tp->undo_marker && (!tp->undo_retrans || tcp_packet_delayed(tp)); | 2706 | return tp->undo_marker && (!tp->undo_retrans || tcp_packet_delayed(tp)); |
2706 | } | 2707 | } |
@@ -2764,9 +2765,9 @@ static void tcp_try_undo_dsack(struct sock *sk) | |||
2764 | * that successive retransmissions of a segment must not advance | 2765 | * that successive retransmissions of a segment must not advance |
2765 | * retrans_stamp under any conditions. | 2766 | * retrans_stamp under any conditions. |
2766 | */ | 2767 | */ |
2767 | static int tcp_any_retrans_done(struct sock *sk) | 2768 | static int tcp_any_retrans_done(const struct sock *sk) |
2768 | { | 2769 | { |
2769 | struct tcp_sock *tp = tcp_sk(sk); | 2770 | const struct tcp_sock *tp = tcp_sk(sk); |
2770 | struct sk_buff *skb; | 2771 | struct sk_buff *skb; |
2771 | 2772 | ||
2772 | if (tp->retrans_out) | 2773 | if (tp->retrans_out) |
@@ -3245,7 +3246,7 @@ static void tcp_cong_avoid(struct sock *sk, u32 ack, u32 in_flight) | |||
3245 | */ | 3246 | */ |
3246 | static void tcp_rearm_rto(struct sock *sk) | 3247 | static void tcp_rearm_rto(struct sock *sk) |
3247 | { | 3248 | { |
3248 | struct tcp_sock *tp = tcp_sk(sk); | 3249 | const struct tcp_sock *tp = tcp_sk(sk); |
3249 | 3250 | ||
3250 | if (!tp->packets_out) { | 3251 | if (!tp->packets_out) { |
3251 | inet_csk_clear_xmit_timer(sk, ICSK_TIME_RETRANS); | 3252 | inet_csk_clear_xmit_timer(sk, ICSK_TIME_RETRANS); |
@@ -3497,7 +3498,7 @@ static inline int tcp_may_update_window(const struct tcp_sock *tp, | |||
3497 | * Window update algorithm, described in RFC793/RFC1122 (used in linux-2.2 | 3498 | * Window update algorithm, described in RFC793/RFC1122 (used in linux-2.2 |
3498 | * and in FreeBSD. NetBSD's one is even worse.) is wrong. | 3499 | * and in FreeBSD. NetBSD's one is even worse.) is wrong. |
3499 | */ | 3500 | */ |
3500 | static int tcp_ack_update_window(struct sock *sk, struct sk_buff *skb, u32 ack, | 3501 | static int tcp_ack_update_window(struct sock *sk, const struct sk_buff *skb, u32 ack, |
3501 | u32 ack_seq) | 3502 | u32 ack_seq) |
3502 | { | 3503 | { |
3503 | struct tcp_sock *tp = tcp_sk(sk); | 3504 | struct tcp_sock *tp = tcp_sk(sk); |
@@ -3673,7 +3674,7 @@ static int tcp_process_frto(struct sock *sk, int flag) | |||
3673 | } | 3674 | } |
3674 | 3675 | ||
3675 | /* This routine deals with incoming acks, but not outgoing ones. */ | 3676 | /* This routine deals with incoming acks, but not outgoing ones. */ |
3676 | static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag) | 3677 | static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) |
3677 | { | 3678 | { |
3678 | struct inet_connection_sock *icsk = inet_csk(sk); | 3679 | struct inet_connection_sock *icsk = inet_csk(sk); |
3679 | struct tcp_sock *tp = tcp_sk(sk); | 3680 | struct tcp_sock *tp = tcp_sk(sk); |
@@ -3810,14 +3811,14 @@ old_ack: | |||
3810 | * But, this can also be called on packets in the established flow when | 3811 | * But, this can also be called on packets in the established flow when |
3811 | * the fast version below fails. | 3812 | * the fast version below fails. |
3812 | */ | 3813 | */ |
3813 | void tcp_parse_options(struct sk_buff *skb, struct tcp_options_received *opt_rx, | 3814 | void tcp_parse_options(const struct sk_buff *skb, struct tcp_options_received *opt_rx, |
3814 | u8 **hvpp, int estab) | 3815 | const u8 **hvpp, int estab) |
3815 | { | 3816 | { |
3816 | unsigned char *ptr; | 3817 | const unsigned char *ptr; |
3817 | struct tcphdr *th = tcp_hdr(skb); | 3818 | const struct tcphdr *th = tcp_hdr(skb); |
3818 | int length = (th->doff * 4) - sizeof(struct tcphdr); | 3819 | int length = (th->doff * 4) - sizeof(struct tcphdr); |
3819 | 3820 | ||
3820 | ptr = (unsigned char *)(th + 1); | 3821 | ptr = (const unsigned char *)(th + 1); |
3821 | opt_rx->saw_tstamp = 0; | 3822 | opt_rx->saw_tstamp = 0; |
3822 | 3823 | ||
3823 | while (length > 0) { | 3824 | while (length > 0) { |
@@ -3928,9 +3929,9 @@ void tcp_parse_options(struct sk_buff *skb, struct tcp_options_received *opt_rx, | |||
3928 | } | 3929 | } |
3929 | EXPORT_SYMBOL(tcp_parse_options); | 3930 | EXPORT_SYMBOL(tcp_parse_options); |
3930 | 3931 | ||
3931 | static int tcp_parse_aligned_timestamp(struct tcp_sock *tp, struct tcphdr *th) | 3932 | static int tcp_parse_aligned_timestamp(struct tcp_sock *tp, const struct tcphdr *th) |
3932 | { | 3933 | { |
3933 | __be32 *ptr = (__be32 *)(th + 1); | 3934 | const __be32 *ptr = (const __be32 *)(th + 1); |
3934 | 3935 | ||
3935 | if (*ptr == htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) | 3936 | if (*ptr == htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) |
3936 | | (TCPOPT_TIMESTAMP << 8) | TCPOLEN_TIMESTAMP)) { | 3937 | | (TCPOPT_TIMESTAMP << 8) | TCPOLEN_TIMESTAMP)) { |
@@ -3947,8 +3948,9 @@ static int tcp_parse_aligned_timestamp(struct tcp_sock *tp, struct tcphdr *th) | |||
3947 | /* Fast parse options. This hopes to only see timestamps. | 3948 | /* Fast parse options. This hopes to only see timestamps. |
3948 | * If it is wrong it falls back on tcp_parse_options(). | 3949 | * If it is wrong it falls back on tcp_parse_options(). |
3949 | */ | 3950 | */ |
3950 | static int tcp_fast_parse_options(struct sk_buff *skb, struct tcphdr *th, | 3951 | static int tcp_fast_parse_options(const struct sk_buff *skb, |
3951 | struct tcp_sock *tp, u8 **hvpp) | 3952 | const struct tcphdr *th, |
3953 | struct tcp_sock *tp, const u8 **hvpp) | ||
3952 | { | 3954 | { |
3953 | /* In the spirit of fast parsing, compare doff directly to constant | 3955 | /* In the spirit of fast parsing, compare doff directly to constant |
3954 | * values. Because equality is used, short doff can be ignored here. | 3956 | * values. Because equality is used, short doff can be ignored here. |
@@ -3969,10 +3971,10 @@ static int tcp_fast_parse_options(struct sk_buff *skb, struct tcphdr *th, | |||
3969 | /* | 3971 | /* |
3970 | * Parse MD5 Signature option | 3972 | * Parse MD5 Signature option |
3971 | */ | 3973 | */ |
3972 | u8 *tcp_parse_md5sig_option(struct tcphdr *th) | 3974 | const u8 *tcp_parse_md5sig_option(const struct tcphdr *th) |
3973 | { | 3975 | { |
3974 | int length = (th->doff << 2) - sizeof (*th); | 3976 | int length = (th->doff << 2) - sizeof(*th); |
3975 | u8 *ptr = (u8*)(th + 1); | 3977 | const u8 *ptr = (const u8 *)(th + 1); |
3976 | 3978 | ||
3977 | /* If the TCP option is too short, we can short cut */ | 3979 | /* If the TCP option is too short, we can short cut */ |
3978 | if (length < TCPOLEN_MD5SIG) | 3980 | if (length < TCPOLEN_MD5SIG) |
@@ -4049,8 +4051,8 @@ static inline void tcp_replace_ts_recent(struct tcp_sock *tp, u32 seq) | |||
4049 | 4051 | ||
4050 | static int tcp_disordered_ack(const struct sock *sk, const struct sk_buff *skb) | 4052 | static int tcp_disordered_ack(const struct sock *sk, const struct sk_buff *skb) |
4051 | { | 4053 | { |
4052 | struct tcp_sock *tp = tcp_sk(sk); | 4054 | const struct tcp_sock *tp = tcp_sk(sk); |
4053 | struct tcphdr *th = tcp_hdr(skb); | 4055 | const struct tcphdr *th = tcp_hdr(skb); |
4054 | u32 seq = TCP_SKB_CB(skb)->seq; | 4056 | u32 seq = TCP_SKB_CB(skb)->seq; |
4055 | u32 ack = TCP_SKB_CB(skb)->ack_seq; | 4057 | u32 ack = TCP_SKB_CB(skb)->ack_seq; |
4056 | 4058 | ||
@@ -4089,7 +4091,7 @@ static inline int tcp_paws_discard(const struct sock *sk, | |||
4089 | * (borrowed from freebsd) | 4091 | * (borrowed from freebsd) |
4090 | */ | 4092 | */ |
4091 | 4093 | ||
4092 | static inline int tcp_sequence(struct tcp_sock *tp, u32 seq, u32 end_seq) | 4094 | static inline int tcp_sequence(const struct tcp_sock *tp, u32 seq, u32 end_seq) |
4093 | { | 4095 | { |
4094 | return !before(end_seq, tp->rcv_wup) && | 4096 | return !before(end_seq, tp->rcv_wup) && |
4095 | !after(seq, tp->rcv_nxt + tcp_receive_window(tp)); | 4097 | !after(seq, tp->rcv_nxt + tcp_receive_window(tp)); |
@@ -4246,7 +4248,7 @@ static void tcp_dsack_extend(struct sock *sk, u32 seq, u32 end_seq) | |||
4246 | tcp_sack_extend(tp->duplicate_sack, seq, end_seq); | 4248 | tcp_sack_extend(tp->duplicate_sack, seq, end_seq); |
4247 | } | 4249 | } |
4248 | 4250 | ||
4249 | static void tcp_send_dupack(struct sock *sk, struct sk_buff *skb) | 4251 | static void tcp_send_dupack(struct sock *sk, const struct sk_buff *skb) |
4250 | { | 4252 | { |
4251 | struct tcp_sock *tp = tcp_sk(sk); | 4253 | struct tcp_sock *tp = tcp_sk(sk); |
4252 | 4254 | ||
@@ -4433,7 +4435,7 @@ static inline int tcp_try_rmem_schedule(struct sock *sk, unsigned int size) | |||
4433 | 4435 | ||
4434 | static void tcp_data_queue(struct sock *sk, struct sk_buff *skb) | 4436 | static void tcp_data_queue(struct sock *sk, struct sk_buff *skb) |
4435 | { | 4437 | { |
4436 | struct tcphdr *th = tcp_hdr(skb); | 4438 | const struct tcphdr *th = tcp_hdr(skb); |
4437 | struct tcp_sock *tp = tcp_sk(sk); | 4439 | struct tcp_sock *tp = tcp_sk(sk); |
4438 | int eaten = -1; | 4440 | int eaten = -1; |
4439 | 4441 | ||
@@ -4917,9 +4919,9 @@ void tcp_cwnd_application_limited(struct sock *sk) | |||
4917 | tp->snd_cwnd_stamp = tcp_time_stamp; | 4919 | tp->snd_cwnd_stamp = tcp_time_stamp; |
4918 | } | 4920 | } |
4919 | 4921 | ||
4920 | static int tcp_should_expand_sndbuf(struct sock *sk) | 4922 | static int tcp_should_expand_sndbuf(const struct sock *sk) |
4921 | { | 4923 | { |
4922 | struct tcp_sock *tp = tcp_sk(sk); | 4924 | const struct tcp_sock *tp = tcp_sk(sk); |
4923 | 4925 | ||
4924 | /* If the user specified a specific send buffer setting, do | 4926 | /* If the user specified a specific send buffer setting, do |
4925 | * not modify it. | 4927 | * not modify it. |
@@ -5028,7 +5030,7 @@ static inline void tcp_ack_snd_check(struct sock *sk) | |||
5028 | * either form (or just set the sysctl tcp_stdurg). | 5030 | * either form (or just set the sysctl tcp_stdurg). |
5029 | */ | 5031 | */ |
5030 | 5032 | ||
5031 | static void tcp_check_urg(struct sock *sk, struct tcphdr *th) | 5033 | static void tcp_check_urg(struct sock *sk, const struct tcphdr *th) |
5032 | { | 5034 | { |
5033 | struct tcp_sock *tp = tcp_sk(sk); | 5035 | struct tcp_sock *tp = tcp_sk(sk); |
5034 | u32 ptr = ntohs(th->urg_ptr); | 5036 | u32 ptr = ntohs(th->urg_ptr); |
@@ -5094,7 +5096,7 @@ static void tcp_check_urg(struct sock *sk, struct tcphdr *th) | |||
5094 | } | 5096 | } |
5095 | 5097 | ||
5096 | /* This is the 'fast' part of urgent handling. */ | 5098 | /* This is the 'fast' part of urgent handling. */ |
5097 | static void tcp_urg(struct sock *sk, struct sk_buff *skb, struct tcphdr *th) | 5099 | static void tcp_urg(struct sock *sk, struct sk_buff *skb, const struct tcphdr *th) |
5098 | { | 5100 | { |
5099 | struct tcp_sock *tp = tcp_sk(sk); | 5101 | struct tcp_sock *tp = tcp_sk(sk); |
5100 | 5102 | ||
@@ -5215,9 +5217,9 @@ out: | |||
5215 | * play significant role here. | 5217 | * play significant role here. |
5216 | */ | 5218 | */ |
5217 | static int tcp_validate_incoming(struct sock *sk, struct sk_buff *skb, | 5219 | static int tcp_validate_incoming(struct sock *sk, struct sk_buff *skb, |
5218 | struct tcphdr *th, int syn_inerr) | 5220 | const struct tcphdr *th, int syn_inerr) |
5219 | { | 5221 | { |
5220 | u8 *hash_location; | 5222 | const u8 *hash_location; |
5221 | struct tcp_sock *tp = tcp_sk(sk); | 5223 | struct tcp_sock *tp = tcp_sk(sk); |
5222 | 5224 | ||
5223 | /* RFC1323: H1. Apply PAWS check first. */ | 5225 | /* RFC1323: H1. Apply PAWS check first. */ |
@@ -5298,7 +5300,7 @@ discard: | |||
5298 | * tcp_data_queue when everything is OK. | 5300 | * tcp_data_queue when everything is OK. |
5299 | */ | 5301 | */ |
5300 | int tcp_rcv_established(struct sock *sk, struct sk_buff *skb, | 5302 | int tcp_rcv_established(struct sock *sk, struct sk_buff *skb, |
5301 | struct tcphdr *th, unsigned len) | 5303 | const struct tcphdr *th, unsigned int len) |
5302 | { | 5304 | { |
5303 | struct tcp_sock *tp = tcp_sk(sk); | 5305 | struct tcp_sock *tp = tcp_sk(sk); |
5304 | int res; | 5306 | int res; |
@@ -5509,9 +5511,9 @@ discard: | |||
5509 | EXPORT_SYMBOL(tcp_rcv_established); | 5511 | EXPORT_SYMBOL(tcp_rcv_established); |
5510 | 5512 | ||
5511 | static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb, | 5513 | static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb, |
5512 | struct tcphdr *th, unsigned len) | 5514 | const struct tcphdr *th, unsigned int len) |
5513 | { | 5515 | { |
5514 | u8 *hash_location; | 5516 | const u8 *hash_location; |
5515 | struct inet_connection_sock *icsk = inet_csk(sk); | 5517 | struct inet_connection_sock *icsk = inet_csk(sk); |
5516 | struct tcp_sock *tp = tcp_sk(sk); | 5518 | struct tcp_sock *tp = tcp_sk(sk); |
5517 | struct tcp_cookie_values *cvp = tp->cookie_values; | 5519 | struct tcp_cookie_values *cvp = tp->cookie_values; |
@@ -5786,7 +5788,7 @@ reset_and_undo: | |||
5786 | */ | 5788 | */ |
5787 | 5789 | ||
5788 | int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, | 5790 | int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, |
5789 | struct tcphdr *th, unsigned len) | 5791 | const struct tcphdr *th, unsigned int len) |
5790 | { | 5792 | { |
5791 | struct tcp_sock *tp = tcp_sk(sk); | 5793 | struct tcp_sock *tp = tcp_sk(sk); |
5792 | struct inet_connection_sock *icsk = inet_csk(sk); | 5794 | struct inet_connection_sock *icsk = inet_csk(sk); |