diff options
author | Michael Brown | 2007-01-04 06:17:28 +0100 |
---|---|---|
committer | Michael Brown | 2007-01-04 06:17:28 +0100 |
commit | 20681d6168dcec08d6da78f47773fa053c5139f1 (patch) | |
tree | f282d05a04436b24a5f4db0675a65e8ad11e224f /src/net/udp.c | |
parent | Don't automatically call gateA20_set() when returning from a real-mode (diff) | |
download | ipxe-20681d6168dcec08d6da78f47773fa053c5139f1.tar.gz ipxe-20681d6168dcec08d6da78f47773fa053c5139f1.tar.xz ipxe-20681d6168dcec08d6da78f47773fa053c5139f1.zip |
Allow empty checksums on received packets
Diffstat (limited to 'src/net/udp.c')
-rw-r--r-- | src/net/udp.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/net/udp.c b/src/net/udp.c index d927e08b..ffe282c9 100644 --- a/src/net/udp.c +++ b/src/net/udp.c @@ -239,12 +239,14 @@ static int udp_rx ( struct pk_buff *pkb, struct sockaddr_tcpip *st_src, rc = -EINVAL; goto done; } - csum = tcpip_continue_chksum ( pshdr_csum, pkb->data, ulen ); - if ( csum != 0 ) { - DBG ( "UDP checksum incorrect (is %04x including checksum " - "field, should be 0000)\n", csum ); - rc = -EINVAL; - goto done; + if ( udphdr->chksum ) { + csum = tcpip_continue_chksum ( pshdr_csum, pkb->data, ulen ); + if ( csum != 0 ) { + DBG ( "UDP checksum incorrect (is %04x including " + "checksum field, should be 0000)\n", csum ); + rc = -EINVAL; + goto done; + } } /* Parse parameters from header and strip header */ |