-
Notifications
You must be signed in to change notification settings - Fork 84
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
tcp,udp: set TOS (TCLASS) for IPv6 sockets #1218
Conversation
Unsure if https://learn.microsoft.com/en-us/windows/win32/winsock/ipproto-ipv6-socket-options I think some other systems also does not support this, so something like this Check should be added: #if defined(IPV6_TCLASS)
... |
829b18c
to
d037a5f
Compare
Good point. Thank you @sreimers. Done. |
Would it be possible to add a small testcase for TOS ? it would be enough with a simple testcase with UDP/TCP socket, set the TOS fields, |
I will look into it. |
1cff992
to
d037a5f
Compare
@alfredh I managed to create a working test with a custom UDP listener which uses I don't think it is worth putting a ton of time into this, since this new IPv6 addition is very simple and unlikely to break things (in part thanks to the I hope this is okay. Attached is a patch with my working test (works on Linux). |
d037a5f
to
ab9206c
Compare
It's enough to ensure tos functions are executed, no need for real low level packet checks. |
Thank you, I just realized that there could be value in that too and I have just added tests for that. Done. |
8203057
to
5921fee
Compare
Seems like the Probably the
is not restrictive enough. |
Will try to reproduce. |
A simple test sending some packets with TOS set is better than nothing ... |
|
||
err = tcp_settos(tt->ts, 184); | ||
err |= tcp_settos(tt->ts, 120); | ||
TEST_ERR(err); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is TOS set on the same tcp server two times ?
is the TOS field working for TCP server or connection ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is TOS set on the same tcp server two times ?
Mistake, removed.
is the TOS field working for TCP server or connection ?
In this test, it is set for all incoming connections on the listening (server) TCP socket. With tcp_conn_settos
we could also set it per connection.
5921fee
to
b473e3f
Compare
Actually, the test fails already in the IPv4 case, so I guess the TOS setting functions have never worked reliably on Windows systems. It turns out that per default, Windows does not allow applications to set the TOS value (if I understand this resource correctly). Should I simply skip the test for Windows systems, since the outcome is dependent on the Windows registry settings? Or does anyone have a better idea how to proceed? |
It should be fine to skip that test for Windows... |
b473e3f
to
ca16f86
Compare
ca16f86
to
9bfbc91
Compare
Done. Let me know if it's okay the way I did it. |
looks good to me ... should we merge it ? |
Yes, I'm all for it. |
No description provided.