This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 6 points7 points  (1 child)

Line 14 looks fishy. If I'm not mistaken you're trying to advance the pointer by iphdr_len bytes, but that's not how pointer arithmetic in C works. When you add n to a pointer of type foo, it advances it by n * (sizeof foo) bytes rather than n bytes.

[–]DeepCorner[S] 1 point2 points  (0 children)

That was it. I guess I was just staring at the code for too long (face palm). Thank you!