@@ -327,9 +327,9 @@ extern int tcp_sendpage(struct sock *sk, struct page *page, int offset,
327327 size_t size , int flags );
328328extern int tcp_ioctl (struct sock * sk , int cmd , unsigned long arg );
329329extern int tcp_rcv_state_process (struct sock * sk , struct sk_buff * skb ,
330- struct tcphdr * th , unsigned len );
330+ const struct tcphdr * th , unsigned int len );
331331extern int tcp_rcv_established (struct sock * sk , struct sk_buff * skb ,
332- struct tcphdr * th , unsigned len );
332+ const struct tcphdr * th , unsigned int len );
333333extern void tcp_rcv_space_adjust (struct sock * sk );
334334extern void tcp_cleanup_rbuf (struct sock * sk , int copied );
335335extern int tcp_twsk_unique (struct sock * sk , struct sock * sktw , void * twp );
@@ -401,10 +401,10 @@ extern void tcp_set_keepalive(struct sock *sk, int val);
401401extern void tcp_syn_ack_timeout (struct sock * sk , struct request_sock * req );
402402extern int tcp_recvmsg (struct kiocb * iocb , struct sock * sk , struct msghdr * msg ,
403403 size_t len , int nonblock , int flags , int * addr_len );
404- extern void tcp_parse_options (struct sk_buff * skb ,
405- struct tcp_options_received * opt_rx , u8 * * hvpp ,
404+ extern void tcp_parse_options (const struct sk_buff * skb ,
405+ struct tcp_options_received * opt_rx , const u8 * * hvpp ,
406406 int estab );
407- extern u8 * tcp_parse_md5sig_option (struct tcphdr * th );
407+ extern const u8 * tcp_parse_md5sig_option (const struct tcphdr * th );
408408
409409/*
410410 * TCP v4 functions exported for the inet6 API
@@ -450,7 +450,7 @@ extern bool cookie_check_timestamp(struct tcp_options_received *opt, bool *);
450450/* From net/ipv6/syncookies.c */
451451extern struct sock * cookie_v6_check (struct sock * sk , struct sk_buff * skb );
452452#ifdef CONFIG_SYN_COOKIES
453- extern __u32 cookie_v6_init_sequence (struct sock * sk , struct sk_buff * skb ,
453+ extern __u32 cookie_v6_init_sequence (struct sock * sk , const struct sk_buff * skb ,
454454 __u16 * mss );
455455#else
456456static inline __u32 cookie_v6_init_sequence (struct sock * sk ,
@@ -522,7 +522,7 @@ static inline int tcp_bound_to_half_wnd(struct tcp_sock *tp, int pktsize)
522522}
523523
524524/* tcp.c */
525- extern void tcp_get_info (struct sock * , struct tcp_info * );
525+ extern void tcp_get_info (const struct sock * , struct tcp_info * );
526526
527527/* Read 'sendfile()'-style from a TCP socket */
528528typedef int (* sk_read_actor_t )(read_descriptor_t * , struct sk_buff * ,
@@ -532,8 +532,8 @@ extern int tcp_read_sock(struct sock *sk, read_descriptor_t *desc,
532532
533533extern void tcp_initialize_rcv_mss (struct sock * sk );
534534
535- extern int tcp_mtu_to_mss (struct sock * sk , int pmtu );
536- extern int tcp_mss_to_mtu (struct sock * sk , int mss );
535+ extern int tcp_mtu_to_mss (const struct sock * sk , int pmtu );
536+ extern int tcp_mss_to_mtu (const struct sock * sk , int mss );
537537extern void tcp_mtup_init (struct sock * sk );
538538extern void tcp_valid_rtt_meas (struct sock * sk , u32 seq_rtt );
539539
@@ -574,7 +574,7 @@ static inline void tcp_fast_path_check(struct sock *sk)
574574/* Compute the actual rto_min value */
575575static inline u32 tcp_rto_min (struct sock * sk )
576576{
577- struct dst_entry * dst = __sk_dst_get (sk );
577+ const struct dst_entry * dst = __sk_dst_get (sk );
578578 u32 rto_min = TCP_RTO_MIN ;
579579
580580 if (dst && dst_metric_locked (dst , RTAX_RTO_MIN ))
@@ -820,6 +820,7 @@ static inline bool tcp_in_initial_slowstart(const struct tcp_sock *tp)
820820static inline __u32 tcp_current_ssthresh (const struct sock * sk )
821821{
822822 const struct tcp_sock * tp = tcp_sk (sk );
823+
823824 if ((1 << inet_csk (sk )-> icsk_ca_state ) & (TCPF_CA_CWR | TCPF_CA_Recovery ))
824825 return tp -> snd_ssthresh ;
825826 else
@@ -832,7 +833,7 @@ static inline __u32 tcp_current_ssthresh(const struct sock *sk)
832833#define tcp_verify_left_out (tp ) WARN_ON(tcp_left_out(tp) > tp->packets_out)
833834
834835extern void tcp_enter_cwr (struct sock * sk , const int set_ssthresh );
835- extern __u32 tcp_init_cwnd (struct tcp_sock * tp , struct dst_entry * dst );
836+ extern __u32 tcp_init_cwnd (const struct tcp_sock * tp , const struct dst_entry * dst );
836837
837838/* Slow start with delack produces 3 packets of burst, so that
838839 * it is safe "de facto". This will be the default - same as
@@ -861,7 +862,7 @@ static inline void tcp_minshall_update(struct tcp_sock *tp, unsigned int mss,
861862
862863static inline void tcp_check_probe_timer (struct sock * sk )
863864{
864- struct tcp_sock * tp = tcp_sk (sk );
865+ const struct tcp_sock * tp = tcp_sk (sk );
865866 const struct inet_connection_sock * icsk = inet_csk (sk );
866867
867868 if (!tp -> packets_out && !icsk -> icsk_pending )
@@ -1209,10 +1210,10 @@ extern struct tcp_md5sig_pool *tcp_get_md5sig_pool(void);
12091210extern void tcp_put_md5sig_pool (void );
12101211
12111212extern int tcp_md5_hash_header (struct tcp_md5sig_pool * , struct tcphdr * );
1212- extern int tcp_md5_hash_skb_data (struct tcp_md5sig_pool * , struct sk_buff * ,
1213+ extern int tcp_md5_hash_skb_data (struct tcp_md5sig_pool * , const struct sk_buff * ,
12131214 unsigned header_len );
12141215extern int tcp_md5_hash_key (struct tcp_md5sig_pool * hp ,
1215- struct tcp_md5sig_key * key );
1216+ const struct tcp_md5sig_key * key );
12161217
12171218/* write queue abstraction */
12181219static inline void tcp_write_queue_purge (struct sock * sk )
@@ -1225,22 +1226,24 @@ static inline void tcp_write_queue_purge(struct sock *sk)
12251226 tcp_clear_all_retrans_hints (tcp_sk (sk ));
12261227}
12271228
1228- static inline struct sk_buff * tcp_write_queue_head (struct sock * sk )
1229+ static inline struct sk_buff * tcp_write_queue_head (const struct sock * sk )
12291230{
12301231 return skb_peek (& sk -> sk_write_queue );
12311232}
12321233
1233- static inline struct sk_buff * tcp_write_queue_tail (struct sock * sk )
1234+ static inline struct sk_buff * tcp_write_queue_tail (const struct sock * sk )
12341235{
12351236 return skb_peek_tail (& sk -> sk_write_queue );
12361237}
12371238
1238- static inline struct sk_buff * tcp_write_queue_next (struct sock * sk , struct sk_buff * skb )
1239+ static inline struct sk_buff * tcp_write_queue_next (const struct sock * sk ,
1240+ const struct sk_buff * skb )
12391241{
12401242 return skb_queue_next (& sk -> sk_write_queue , skb );
12411243}
12421244
1243- static inline struct sk_buff * tcp_write_queue_prev (struct sock * sk , struct sk_buff * skb )
1245+ static inline struct sk_buff * tcp_write_queue_prev (const struct sock * sk ,
1246+ const struct sk_buff * skb )
12441247{
12451248 return skb_queue_prev (& sk -> sk_write_queue , skb );
12461249}
@@ -1254,7 +1257,7 @@ static inline struct sk_buff *tcp_write_queue_prev(struct sock *sk, struct sk_bu
12541257#define tcp_for_write_queue_from_safe (skb , tmp , sk ) \
12551258 skb_queue_walk_from_safe(&(sk)->sk_write_queue, skb, tmp)
12561259
1257- static inline struct sk_buff * tcp_send_head (struct sock * sk )
1260+ static inline struct sk_buff * tcp_send_head (const struct sock * sk )
12581261{
12591262 return sk -> sk_send_head ;
12601263}
@@ -1265,7 +1268,7 @@ static inline bool tcp_skb_is_last(const struct sock *sk,
12651268 return skb_queue_is_last (& sk -> sk_write_queue , skb );
12661269}
12671270
1268- static inline void tcp_advance_send_head (struct sock * sk , struct sk_buff * skb )
1271+ static inline void tcp_advance_send_head (struct sock * sk , const struct sk_buff * skb )
12691272{
12701273 if (tcp_skb_is_last (sk , skb ))
12711274 sk -> sk_send_head = NULL ;
0 commit comments