Messages in this thread | | | From | kuznet@ms2 ... | Subject | Re: [TEST FIX] Re: SSH Hangs in 2.5.59 and 2.5.55 but not 2.4.x, | Date | Wed, 29 Jan 2003 06:14:55 +0300 (MSK) |
| |
Hello!
> BTW, Alexey, please please explain to me how that trick made > by tcp_trim_head() works. :-) I am talking about how it is > setting ip_summed to CHECKSUM_HARDWARE blindly and not even > bothering to set skb->csum correctly.
skb->csum is not used inside TCP when skb->ip_summed==CHECKSUM_HW:
void tcp_v4_send_check(struct sock *sk, struct tcphdr *th, int len, struct sk_buff *skb) { struct inet_opt *inet = inet_sk(sk);
if (skb->ip_summed == CHECKSUM_HW) { th->check = ~tcp_v4_check(th, len, inet->saddr, inet->daddr, 0); skb->csum = offsetof(struct tcphdr, check);
And when pushing segment down to IP, it is initialized to offset of th->check.
So, it is safe to make skb->ip_summed := CHECKSUM_HW any moment when we are lazy to recalculate checksum. Frankly speaking, it is not very good, I was confused _a_ _lot_ when seeing wrong checksums on those bogus zero-length packets in tcpdumps made by Christopher. But saves some source lines.
Alexey - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |