[PATCH mptcp-net 3/3] mptcp: pm: align endpoint flags size with the NL specs

Matthieu Baerts (NGI0) posted 3 patches 18 hours ago
[PATCH mptcp-net 3/3] mptcp: pm: align endpoint flags size with the NL specs
Posted by Matthieu Baerts (NGI0) 18 hours ago
The MPTCP Netlink specs describe the 'flags' as a u32 type. Internally,
a u8 type was used.

Using a u8 is currently fine, because only the 5 first bits are used.
But there is also no reason not to be aligns with the specs, and
to stick to a u8. Especially because there is a whole of 3 bytes after
in both mptcp_pm_local and mptcp_pm_addr_entry structures.

Also, setting it to a u32 will allow future flags, just in case.

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
This is for mptcp-next, and it explains why setting flags between the
8th to the 31st bit in the previous patch didn't have any effect.
---
 net/mptcp/protocol.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index 199f28f3dd5e..d98c0cfa5889 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -247,14 +247,14 @@ struct mptcp_pm_data {
 
 struct mptcp_pm_local {
 	struct mptcp_addr_info	addr;
-	u8			flags;
+	u32			flags;
 	int			ifindex;
 };
 
 struct mptcp_pm_addr_entry {
 	struct list_head	list;
 	struct mptcp_addr_info	addr;
-	u8			flags;
+	u32			flags;
 	int			ifindex;
 	struct socket		*lsk;
 };

-- 
2.51.0