소스 검색

Allow empty checksums on received packets

tags/v0.9.3
Michael Brown 17 년 전
부모
커밋
20681d6168
1개의 변경된 파일8개의 추가작업 그리고 6개의 파일을 삭제
  1. 8
    6
      src/net/udp.c

+ 8
- 6
src/net/udp.c 파일 보기

@@ -239,12 +239,14 @@ static int udp_rx ( struct pk_buff *pkb, struct sockaddr_tcpip *st_src,
239 239
 		rc = -EINVAL;
240 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 252
 	/* Parse parameters from header and strip header */

Loading…
취소
저장