diff options
author | Alan Cox <alan@linux.intel.com> | 2012-09-19 10:46:06 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-09-20 17:29:36 -0400 |
commit | 4308fc58dceda40fac8a8d9c05b7cfba0a6bbed3 (patch) | |
tree | addfb9116bc2de864d020bcda4c478aa1c3edf7b /net/ipv4/tcp_minisocks.c | |
parent | bb68b64724a4fd6b93d83b39aeffa4aadb2562fc (diff) |
tcp: Document use of undefined variable.
Both tcp_timewait_state_process and tcp_check_req use the same basic
construct of
struct tcp_options received tmp_opt;
tmp_opt.saw_tstamp = 0;
then call
tcp_parse_options
However if they are fed a frame containing a TCP_SACK then tbe code
behaviour is undefined because opt_rx->sack_ok is undefined data.
This ought to be documented if it is intentional.
Signed-off-by: Alan Cox <alan@linux.intel.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.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index e965319d610b..5792577b5bc5 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c | |||
@@ -85,6 +85,8 @@ static bool tcp_in_window(u32 seq, u32 end_seq, u32 s_win, u32 e_win) | |||
85 | * spinlock it. I do not want! Well, probability of misbehaviour | 85 | * spinlock it. I do not want! Well, probability of misbehaviour |
86 | * is ridiculously low and, seems, we could use some mb() tricks | 86 | * is ridiculously low and, seems, we could use some mb() tricks |
87 | * to avoid misread sequence numbers, states etc. --ANK | 87 | * to avoid misread sequence numbers, states etc. --ANK |
88 | * | ||
89 | * We don't need to initialize tmp_out.sack_ok as we don't use the results | ||
88 | */ | 90 | */ |
89 | enum tcp_tw_status | 91 | enum tcp_tw_status |
90 | tcp_timewait_state_process(struct inet_timewait_sock *tw, struct sk_buff *skb, | 92 | tcp_timewait_state_process(struct inet_timewait_sock *tw, struct sk_buff *skb, |
@@ -522,6 +524,8 @@ EXPORT_SYMBOL(tcp_create_openreq_child); | |||
522 | * | 524 | * |
523 | * XXX (TFO) - The current impl contains a special check for ack | 525 | * XXX (TFO) - The current impl contains a special check for ack |
524 | * validation and inside tcp_v4_reqsk_send_ack(). Can we do better? | 526 | * validation and inside tcp_v4_reqsk_send_ack(). Can we do better? |
527 | * | ||
528 | * We don't need to initialize tmp_opt.sack_ok as we don't use the results | ||
525 | */ | 529 | */ |
526 | 530 | ||
527 | struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb, | 531 | struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb, |