]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: fix loop in ofo handling code and reduce its complexity
authorIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
Fri, 29 May 2009 22:02:29 +0000 (15:02 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 29 May 2009 22:02:29 +0000 (15:02 -0700)
commit59a974d02494d64e5700a9aa6c16667f91000795
treeeb92c3ef77973295469743a1087c551acf7ece67
parentdcb6f6121fd5ad8fd56ccb5db9d08e1f7b3f3d4e
tcp: fix loop in ofo handling code and reduce its complexity

Somewhat luckily, I was looking into these parts with very fine
comb because I've made somewhat similar changes on the same
area (conflicts that arose weren't that lucky though). The loop
was very much overengineered recently in commit 22640fe8224c3
(tcp: Use SKB queue and list helpers instead of doing it
by-hand), while it basically just wants to know if there are
skbs after 'skb'.

Also it got broken because skb1 = skb->next got translated into
skb1 = skb1->next (though abstracted) improperly. Note that
'skb1' is pointing to previous sk_buff than skb or NULL if at
head. Two things went wrong:
- We'll kfree 'skb' on the first iteration instead of the
  skbuff following 'skb' (it would require required SACK reneging
  to recover I think).
- The list head case where 'skb1' is NULL is checked too early
  and the loop won't execute whereas it previously did.

Conclusion, mostly revert the recent changes which makes the
cset very messy looking but using proper accessor in the
previous-like version.

The effective changes against the original can be viewed with:
  git-diff 22640fe8224c32e09cdf9a4623ea23496bb47d72^ \
net/ipv4/tcp_input.c | sed -n -e '57,70 p'

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_input.c