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

Only trace ipv4 not working without kernel CONF_IPV6 set #5192

Open
K-PANIK opened this issue Jan 17, 2025 · 4 comments
Open

Only trace ipv4 not working without kernel CONF_IPV6 set #5192

K-PANIK opened this issue Jan 17, 2025 · 4 comments

Comments

@K-PANIK
Copy link

K-PANIK commented Jan 17, 2025

I have a systematic issue to use only trace IPv4 family for tcpconnect and network performance tools.
A python error code notices that ipv6 structs are undefined...

So I am not able to use network tools because my kernel do not compile conf_ipv6. Is it normal?
Network BCC tools hard depends on CONF_IPV6 ? It wasn't written to readme requierments so I am asking if they is a way to do it without this dependency. Perhaps I can rewrite your python codes to exclude ipv6 support.

BCC is an amazing tools suites. Good continuation.

Best regard,

@chenhengqi
Copy link
Collaborator

Please post the error logs or stacktrace here.

@K-PANIK
Copy link
Author

K-PANIK commented Jan 26, 2025

I have a fix and it works on my branch.

You've provided options to monitor only ipv4 kernel socket but to bcc compile only ipv4 wasn't actually supported. Ipv4 only has to be propagate to kernel without ipv6 headers.

I have experimented and tested ok on my branch. I will fullfill it for all network BCC monitoring application.

Branch for tcpconnect.py:
https://github.com/K-PANIK/bcc/tree/feature/ipv4_without_ivp6_kernel

Commit:
K-PANIK@3c42ab2

I have noticed that bcc source code is not factorised. For example, struct ipv4_data_t is redefined in all source tcp*.py and is sometimes heterogeneously defined. Same for ipv6 struct definition. I think you can do better.

Regards,
K.P

@chenhengqi
Copy link
Collaborator

Would you might opening a new PR. I think we can use the existing -4, -6 options.

@K-PANIK
Copy link
Author

K-PANIK commented Jan 27, 2025

Ofcourse these options have to be used. Currently, if -4 is used , bcc try to compile ipv6 headers for monitoring stats too, and then python scripts display only ipv4 stats.
Remember my case, my kernel config_ipv6 is not set.

Just a question, tools/tcp*.py are they template or official tools for users?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants