diff options
author | Michael Brown <mcb30@etherboot.org> | 2006-07-19 23:38:05 +0000 |
---|---|---|
committer | Michael Brown <mcb30@etherboot.org> | 2006-07-19 23:38:05 +0000 |
commit | 2c0eb6eb1dc2b3828adad19ff46aeffae95b0102 (patch) | |
tree | 37de4267c2cf9d1df9fd233de0dab9b7fa57df4d /src/net/udp.c | |
parent | 0768670fd8599555de4476e5494c07b4e1b854b6 (diff) | |
download | ipxe-2c0eb6eb1dc2b3828adad19ff46aeffae95b0102.tar.gz |
Correct TCP/IP checksum generation.
Diffstat (limited to 'src/net/udp.c')
-rw-r--r-- | src/net/udp.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/net/udp.c b/src/net/udp.c index 87795d4db..d04c94bb6 100644 --- a/src/net/udp.c +++ b/src/net/udp.c @@ -142,11 +142,8 @@ int udp_sendto ( struct udp_connection *conn, struct sockaddr *peer, udphdr->dest_port = *dest; udphdr->source_port = conn->local_port; udphdr->len = htons ( pkb_len ( conn->tx_pkb ) ); - /** - * Calculate the partial checksum. Note this is stored in host byte - * order. - */ - udphdr->chksum = calc_chksum ( udphdr, sizeof ( *udphdr ) + len ); + udphdr->chksum = 0; + udphdr->chksum = tcpip_chksum ( udphdr, sizeof ( *udphdr ) + len ); /** * Dump the contents of the UDP header @@ -238,7 +235,7 @@ void udp_rx ( struct pk_buff *pkb, struct in_addr *src_net_addr __unused, } /* Verify the checksum */ - chksum = calc_chksum ( pkb->data, pkb_len ( pkb ) ); + chksum = tcpip_chksum ( pkb->data, pkb_len ( pkb ) ); if ( chksum != 0xffff ) { DBG ( "Bad checksum %d\n", chksum ); return; |