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

Add support to record IPv4 encapsulated packets #35

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Shikugawa
Copy link

@Shikugawa Shikugawa commented Jun 20, 2023

This PR adds support to collect flow logs for IPv4 encapsulated packets.

@Shikugawa Shikugawa marked this pull request as ready for review June 22, 2023 13:50
@Shikugawa
Copy link
Author

@slankdev Please check it. cc @proelbtn @ninilosso

if (inner_ih->ihl < 5)
return TC_ACT_SHOT;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the IP header has options, inner_ih->ihl will be greater than 5, right? If you add the IP header (20) length in process_ipv4_tcp, you may need to implement it like the following?

Suggested change
if (inner_ih->ihl < 5)
return TC_ACT_SHOT;
if (inner_ih->ihl != 5)
return TC_ACT_SHOT;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or you need to calculate correct offset with ih->ihl.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this tool supports IP option (ihl > 5) but current this PR doesn't calculate offset of inner IP with correct ihl. So let me fix it.

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

Successfully merging this pull request may close these issues.

2 participants