Subject: Re: calculation in UDP
To: Thomas Finneid <tfinneid@ifi.uio.no>
From: None <netbsd@gve.ch>
List: tech-net
Date: 12/07/2002 14:57:46
hi,
it seems the code is in the file sys/netinet/udp_usrreq.c
in udp_output():

        /*
         * Set up checksum and output datagram.
         */
		ui->ui_sum = in_cksum_phdr(ui->ui_src.s_addr,
                  ui->ui_dst.s_addr, htons((u_int16_t)len +
                  sizeof(struct udphdr) + IPPROTO_UDP));
                m->m_pkthdr.csum_flags = M_CSUM_UDPv4;
                m->m_pkthdr.csum_data = offsetof(struct udphdr, uh_sum);



On Sat, Dec 07, 2002 at 01:45:05PM +0100, Thomas Finneid wrote:
> 
> Hi
> 
> I am doing some analysis work on the network protocol stack, and are trying
> to find out where in the code in_cksum is being called in a udp output
> scenario. I have search the through the code and I found it for the input
> chain of udp but not for output. I have also search through the web and the
> mail but found nothing. Could any one be as kind as to point me in the
> right direction, or give me an explenation of how checksumming is invoked
> in udp output.
> 
> regards
> 
> -- 
> Thomas Finneid
> 
> email: tfinneid@ifi.uio.no
> 
> 
> 

--------------------------------------------------------------------
Key fingerprint = D34A 577C 869B 28A2 3886  4298 50CB DC18 31A4 ACAD
--------------------------------------------------------------------
email: jmab@gve.ch / netbsd@gve.ch -- www.netbsd.org