Skip to content

Commit 8eeb50d

Browse files
committed
checksum: properly crate zero'd out, one byte Cstruct.t
1 parent 5fbd4ea commit 8eeb50d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Packet.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ module Tcp = struct
222222
let chksum = Checksum.ones_complement_list
223223
(if (length mod 2) = 0
224224
then [pseudo_header; Cstruct.sub bits 0 length]
225-
else [pseudo_header; Cstruct.sub bits 0 length; Cstruct.create 0]) in
225+
else [pseudo_header; Cstruct.sub bits 0 length; Cstruct.of_string "\x00"]) in
226226
set_tcp_chksum bits chksum
227227
end
228228

0 commit comments

Comments
 (0)