On 22/06/2019 01:55, Mat Martineau wrote:
While debugging socket state transitions in MPTCP sockets, I found
MPTCP sockets were listing IPPROTO_TCP as their protocol in
/sys/kernel/debug/tracing/trace. sock->sk_protocol was only 8 bits wide,
truncating the new value of IPPROTO_MPTCP (0x0106) to IPPROTO_TCP
The networking code has varying integer widths for 'protocol' at
* POSIX socket API: 32 bits
* sk_buff->protocol: 16 bits
* IP header (on the wire): 8 bits
MPTCP shows a use for protocol values outside those that fit in an IP
header. The change to struct sock fills an 8-bit hole, so there is no
change in the size of the structure.
Given that we are currently discussing the appropriate value for
IPPROTO_MPTCP, I'm sending this as an RFC to inform those discussions. I
had previously thought that the 16-bit value for IPPROTO_MPTCP was
compatible with the existing code base.
Mat Martineau (3):
net: Make sock protocol value checks more specific
sock: Make sk_protocol a 16-bit value
net: Add IPPROTO_MPTCP to inet_sock_set_state tracepoint output
Thank you for the patches!
As discussed yesterday, we said it is OK to add them in our repo and
wait for feedback from maintainers later.
I added the 2 firsts ones just before "tcp: Define IPPROTO_MPTCP" and
"squashed" the last one in "tcp: Define IPPROTO_MPTCP", see
a4ed239bad09. The result is visible there: 7312e2219900..78d9680a7731
I hope it is what you had in mind, I can of course change that later if
Tests are still OK!
Matthieu Baerts | R&D Engineer
Tessares SA | Hybrid Access Solutions
1 Avenue Jean Monnet, 1348 Louvain-la-Neuve, Belgium