|
-
January 3rd, 2024, 01:02 PM
#13
Re: Using npcap libs to save packet causes memory fault
Assuming you don't come unstuck with a bus error due to bad pointer alignment (not an issue on x86), you want something like
shortTTL = ntohs(*((u_short*)ptrCurrent_Field));
The red part casts your ptrCurrent_Field to be a pointer to a u_short, which is then dereferenced to produce a u_short.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|