Prev: [PATCH v4 2/7] net: remove old tcp_optlen function
Next: [PATCH v6 4/7] tcp: input header length, prediction, and timestamp bugs
From: William Allen Simpson on 11 Mar 2010 07:10 Harmonize tcp_v4_rcv() and tcp_v6_rcv() -- better document tcp doff and header length assumptions, and carefully compare implementations. Reduces multiply/shifts, marginally improving speed. Removes redundant tcp header length checks before checksumming. Instead, assumes (and documents) that any backlog processing and transform policies will carefully preserve the header, and will ensure the socket buffer length remains >= the header size. Quoth David Miller: Not true. The skb->len can be modified by the call to sk_filter() done by tcp_v4_rcv(). Therefore, added extra redundant checks for any sk_filter() problems, also in tcp_v6_rcv(). [updated comments, resolved conflicts] Stand-alone patch, originally developed for TCPCT. Signed-off-by: William.Allen.Simpson(a)gmail.com Reviewed-by: Andi Kleen <andi(a)firstfloor.org> --- include/net/xfrm.h | 7 +++++ net/ipv4/tcp_ipv4.c | 57 ++++++++++++++++++++++++--------------- net/ipv6/tcp_ipv6.c | 72 +++++++++++++++++++++++++++++++------------------- 3 files changed, 87 insertions(+), 49 deletions(-) |