Skip to content

Commit

Permalink
fix kaitoy#94 - UDP checksum 0xFFFF
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkoetter committed May 9, 2017
1 parent a346091 commit b9d7ef0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pcap4j-core/src/main/java/org/pcap4j/packet/UdpPacket.java
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,8 @@ private short calcChecksum(
);
destPos += SHORT_SIZE_IN_BYTES;

return ByteArrays.calcChecksum(data);
short checksum = ByteArrays.calcChecksum(data);
return checksum != 0 ? checksum : (short)0xFFFF;
}

/**
Expand Down

0 comments on commit b9d7ef0

Please sign in to comment.