Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue while decoding fragmentation flags in IP packet decoding #1

Open
YannGarcia opened this issue Apr 16, 2021 · 0 comments
Open

Comments

@YannGarcia
Copy link

YannGarcia commented Apr 16, 2021

Hello,

The issue is located in src/c/packet_ip.c lines 50 to 52 where fragmentation flags (Don't fragment and More fragment flags) are not processed properly.
A call to C ntohs() function shall be used:

  • (jboolean)(((ntohs(ip_pkt->ip_off)&IP_RF)>0)?JNI_TRUE:JNI_FALSE),
  • (jboolean)((((ntohs(ip_pkt->ip_off)) &IP_DF)>0)?JNI_TRUE:JNI_FALSE),
  • (jboolean)(((ntohs(ip_pkt->ip_off) &IP_MF)>0)?JNI_TRUE:JNI_FALSE),

This fixed was tested on both Win10 & Linux Ubuntu 18.04 TLS

In addition, I also replace line 44:

  • (jbyte)ip_pkt->ip_v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant