Browse Source

Allow empty checksums on received packets

tags/v0.9.3
Michael Brown 17 years ago
parent
commit
20681d6168
1 changed files with 8 additions and 6 deletions
  1. 8
    6
      src/net/udp.c

+ 8
- 6
src/net/udp.c View File

239
 		rc = -EINVAL;
239
 		rc = -EINVAL;
240
 		goto done;
240
 		goto done;
241
 	}
241
 	}
242
-	csum = tcpip_continue_chksum ( pshdr_csum, pkb->data, ulen );
243
-	if ( csum != 0 ) {
244
-		DBG ( "UDP checksum incorrect (is %04x including checksum "
245
-		      "field, should be 0000)\n", csum );
246
-		rc = -EINVAL;
247
-		goto done;
242
+	if ( udphdr->chksum ) {
243
+		csum = tcpip_continue_chksum ( pshdr_csum, pkb->data, ulen );
244
+		if ( csum != 0 ) {
245
+			DBG ( "UDP checksum incorrect (is %04x including "
246
+			      "checksum field, should be 0000)\n", csum );
247
+			rc = -EINVAL;
248
+			goto done;
249
+		}
248
 	}
250
 	}
249
 
251
 
250
 	/* Parse parameters from header and strip header */
252
 	/* Parse parameters from header and strip header */

Loading…
Cancel
Save