소스 검색

SER-324 fix: dont throw away terminating zero from payload

Jiri Kuthan 17 년 전
부모
커밋
35ab13d8b1
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      udp_server.c

+ 6 - 1
udp_server.c

@@ -477,7 +477,12 @@ int udp_rcv_loop()
 #ifdef USE_STUN
 		}
 #endif
-#ifndef USE_STUN
+/* historically, zero-terminated packets indicated a bug in clients
+ * that calculated wrongly packet length and included string-terminating
+ * zero; today clients exist with legitimate binary payloads and we
+ * shall not check for zero-terminated payloads
+ */
+#ifdef TRASH_ZEROTERMINATED_PACKETS
 		if (buf[len-1]==0) {
 			tmp=ip_addr2a(&ri.src_ip);
 			LOG(L_WARN, "WARNING: udp_rcv_loop: "