Allow empty checksums on received packets
authorMichael Brown <mcb30@etherboot.org>
Thu, 4 Jan 2007 05:17:28 +0000 (05:17 +0000)
committerMichael Brown <mcb30@etherboot.org>
Thu, 4 Jan 2007 05:17:28 +0000 (05:17 +0000)
src/net/udp.c

index d927e08..ffe282c 100644 (file)
@@ -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 */