summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Kochan <vadim4j@gmail.com>2016-07-16 12:39:44 +0300
committerTobias Klauser <tklauser@distanz.ch>2016-07-18 14:45:28 +0200
commit20f72d2b68969f75b0a116e49b133363d4b6fb9a (patch)
treee6db993b6049c56fed6ba23a8ff5bbc73c529293
parent9ad5ccd66e89778e33cd1be3cd8887ec4a03d177 (diff)
trafgen: udp: Do not use user-provided 'len' field to calculate csum
Do not use user-provided 'len' field for csum calculation which is potentially dangerous due to possible read buffer overflows. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> [tk: reword commit message] Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r--trafgen_l4.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/trafgen_l4.c b/trafgen_l4.c
index c109675..79c5914 100644
--- a/trafgen_l4.c
+++ b/trafgen_l4.c
@@ -44,8 +44,6 @@ static void udp_packet_finish(struct proto_hdr *hdr)
if (!lower)
return;
- total_len = proto_field_get_u16(hdr, UDP_LEN);
-
switch (lower->id) {
case PROTO_IP4:
csum = p4_csum((void *) proto_header_ptr(lower), proto_header_ptr(hdr),