Re: [PATCH] act_nat: the checksum of ICMP doesn't have pseudo header

From: Changli Gao
Date: Fri Jul 30 2010 - 10:16:31 EST


On Fri, Jul 30, 2010 at 6:24 PM, Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> wrote:
>
> The checksum update is for the inner IP header.  netfilter does
> of course update the checksum, it just doesn't do it here which is
> for the outer IP header.
>

I know we need to update the ICMP checksum if we alter the payload(the
inner IP header here) of ICMP. But I doubt if the update is really
necessary if the checksum is partial, as the checksum will be done
later(by ether skb_checksum_help() or NIC hardware). In fact, as there
isn't any pseudo header, the icmph->checksum should be always ZERO,
otherwise skb_checksum_help() or NIC will give the wrong checksums,
when the checksum is partial.

--
Regards,
Changli Gao(xiaosuo@xxxxxxxxx)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/