Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Alan Cox and committed by
David S. Miller
4308fc58 bb68b647

+4
+4
net/ipv4/tcp_minisocks.c
··· 85 85 * spinlock it. I do not want! Well, probability of misbehaviour 86 86 * is ridiculously low and, seems, we could use some mb() tricks 87 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 91 enum tcp_tw_status 90 92 tcp_timewait_state_process(struct inet_timewait_sock *tw, struct sk_buff *skb, ··· 524 522 * 525 523 * XXX (TFO) - The current impl contains a special check for ack 526 524 * validation and inside tcp_v4_reqsk_send_ack(). Can we do better? 525 + * 526 + * We don't need to initialize tmp_opt.sack_ok as we don't use the results 527 527 */ 528 528 529 529 struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb,