-
Notifications
You must be signed in to change notification settings - Fork 344
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
BUG: Interface-specific binding and packet marking broken #485
Comments
I also verified that this exists in |
Interesting. From that commit, it seems like there are code paths which are not executing.
I don't know what you're intending. The |
about 'Bug 2', from the code, it seems only tcp and sctp support -M/--mark, could you try by --tcp ? |
|
I don't think this makes sense. Marks are a meta attribute assigned by the Linux kernel and work with all packet types. Even if there was some limitation in the implementation, the correct behavior would be to kill the program with an error message after the argument parser. |
Yes, I agree with you, but now mtr indeed only support it in tcp and sctp, hoping maintainer could pay attention to this. |
I'll consider into fixing these issues next weekend, assuming the fixes are reasonable. Before I spend time on this, I want to ensure there is an active maintainer who will work with me to merge any fixes. |
yes. I will merge "reasonable" looking fixes. |
I had a chance to start examining this over the weekend, although I haven't yet compiled a patch. My preliminary analysis of Bug 2 has led me to identify two issues; however, these findings may change upon more rigorous testing. The first issue is with Additionally, there may be a need for Lines 60 to 71 in 74d312d
The second issue pertains to the selection of the source address on Linux systems. The Routing Policy Database (RPDB) can influence which routing table gets selected, and consequently, which source address is chosen. Currently, the packet mark is not set during this selection process, leading to the use of an incorrect source address. This pattern occurs multiple times in Lines 314 to 351 in 74d312d
|
Good investigation. With regard to dropping When you do finish writing a patch for these issues, please include detailed and explicit comments in the code on what these issues are and how your changes fix them. They aren't obvious. |
With regards to setting the source address, I don't remember the full history of that, but it would be wise to test that change on as many operating systems as you can to verify it doesn't break anything for non-Linux usage. When |
I'm closing this issue since both of these problems are now fixed. Please see #491 for a follow up proposal. |
I am reporting two distinct issues related to the 'mtr' network diagnostic tool. The first issue (Bug 1) arises when specifying a network interface using the '-I' flag; contrary to expectations, 'mtr' does not bind directly to the specified device but seems to consult the system's routing table instead. This results in packets being sent via an unintended interface, leading to diagnostic inaccuracies. The second issue (Bug 2) occurs when using the '-M' flag to set a firewall mark on packets; despite setting the mark, it appears that 'mtr' does not actually apply it, causing the packets to not follow the expected policy-based routing rules. These two issues hinder the tool's effectiveness in specialized network diagnostics.
To demonstrate these issues, I have created a small proof of concept using Linux network namespaces to demonstrate the bug. Conceptually, it simulates two boxes with two connected interfaces:
The following tests were conducted on Linux 6.1.51-1-lts using mtr version 0.95.
The text was updated successfully, but these errors were encountered: