aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_minisocks.c
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2011-10-21 05:22:42 -0400
committerDavid S. Miller <davem@davemloft.net>2011-10-21 05:22:42 -0400
commitcf533ea53ebfae41be15b103d78e7ebec30b9969 (patch)
tree51ed3c69f4a15117fefe5cbd291a75010beb0f4b /net/ipv4/tcp_minisocks.c
parentf04565ddf52e401880f8ba51de0dff8ba51c99fd (diff)
tcp: add const qualifiers where possible
Adding const qualifiers to pointers can ease code review, and spot some bugs. It might allow compiler to optimize code further. For example, is it legal to temporary write a null cksum into tcphdr in tcp_md5_hash_header() ? I am afraid a sniffer could catch the temporary null value... Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_minisocks.c')
-rw-r--r--net/ipv4/tcp_minisocks.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index d2fe4e06b472..b767a951d47c 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -141,7 +141,7 @@ tcp_timewait_state_process(struct inet_timewait_sock *tw, struct sk_buff *skb,
141 const struct tcphdr *th) 141 const struct tcphdr *th)
142{ 142{
143 struct tcp_options_received tmp_opt; 143 struct tcp_options_received tmp_opt;
144 u8 *hash_location; 144 const u8 *hash_location;
145 struct tcp_timewait_sock *tcptw = tcp_twsk((struct sock *)tw); 145 struct tcp_timewait_sock *tcptw = tcp_twsk((struct sock *)tw);
146 int paws_reject = 0; 146 int paws_reject = 0;
147 147
@@ -566,7 +566,7 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb,
566 struct request_sock **prev) 566 struct request_sock **prev)
567{ 567{
568 struct tcp_options_received tmp_opt; 568 struct tcp_options_received tmp_opt;
569 u8 *hash_location; 569 const u8 *hash_location;
570 struct sock *child; 570 struct sock *child;
571 const struct tcphdr *th = tcp_hdr(skb); 571 const struct tcphdr *th = tcp_hdr(skb);
572 __be32 flg = tcp_flag_word(th) & (TCP_FLAG_RST|TCP_FLAG_SYN|TCP_FLAG_ACK); 572 __be32 flg = tcp_flag_word(th) & (TCP_FLAG_RST|TCP_FLAG_SYN|TCP_FLAG_ACK);