From 20681d6168dcec08d6da78f47773fa053c5139f1 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 4 Jan 2007 05:17:28 +0000 Subject: [PATCH] Allow empty checksums on received packets --- src/net/udp.c | 14 ++++++++------ 1 file 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 */