Skip to content

Commit

Permalink
fix ethertype check
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed May 18, 2022
1 parent 2fc5b96 commit 58660d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/pkt-gen/pkt-gen.c
Original file line number Diff line number Diff line change
Expand Up @@ -1557,7 +1557,7 @@ pong_body(void *data)
dpkt[4] = spkt[1];
dpkt[5] = spkt[2];
/* swap source and destination IPv4 */
if (ntohs(spkt[6]) & ETHERTYPE_IP) {
if (spkt[6] == htons(ETHERTYPE_IP)) {
dpkt[13] = spkt[15];
dpkt[14] = spkt[16];
dpkt[15] = spkt[13];
Expand Down

0 comments on commit 58660d0

Please sign in to comment.