Re: TCP CHECKSUMS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Mal Hacker wrote:

> TCP checksums are evaluated by attaching a pseudo
> header in the start of the TCP segment which u are
> going to be sent. Actually that pseudo header is like
> this...
> 
> struct pseudohdr
> {
>         struct in_addr source_address;  // 32 bit netid/hostid
>         struct in_addr dest_address;    // 32 bit netid/hostid
>         unsigned char place_holder;
>         unsigned char protocol;
>         unsigned short length;
>         struct tcphdr tcp;
> } phdr;
> 
> 
> where the protocol is IPPROTO_TCP , place holder is
> zero and length is htons(sizeof(struct tcphdr));

length is the length of the header and data, not just the header.

-- 
Glynn Clements <glynn.clements@virgin.net>
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux