From: Matthieu Baerts (NGI0) Date: Mon, 24 Nov 2025 11:19:26 +0000 (+0100) Subject: mptcp: monitor: support 'server side' as a flag X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1be9ef2947971dc0001d1e1cb1e488835b07da54;p=thirdparty%2Fiproute2.git mptcp: monitor: support 'server side' as a flag In the v6.18 kernel, the 'server side' attribute has been deprecated [1] in favour of the 'server side' flag [2]. Support both: first checking the new flag, then the old attribute to continue supporting older kernels. Link: https://git.kernel.org/torvalds/c/c8bc168f5f3d [1] Link: https://git.kernel.org/torvalds/c/3d7ae91107b8 [2] Signed-off-by: Matthieu Baerts (NGI0) Signed-off-by: David Ahern --- diff --git a/ip/ipmptcp.c b/ip/ipmptcp.c index 01f6906f..acd008f3 100644 --- a/ip/ipmptcp.c +++ b/ip/ipmptcp.c @@ -535,11 +535,14 @@ static int mptcp_monitor_msg(struct rtnl_ctrl_data *ctrl, printf(" reset_reason=%u", rta_getattr_u32(tb[MPTCP_ATTR_RESET_REASON])); if (tb[MPTCP_ATTR_RESET_FLAGS]) printf(" reset_flags=0x%x", rta_getattr_u32(tb[MPTCP_ATTR_RESET_FLAGS])); - if (tb[MPTCP_ATTR_SERVER_SIDE] && rta_getattr_u8(tb[MPTCP_ATTR_SERVER_SIDE])) - printf(" server_side"); if (tb[MPTCP_ATTR_FLAGS]) flags = rta_getattr_u16(tb[MPTCP_ATTR_FLAGS]); + if ((flags & MPTCP_PM_EV_FLAG_SERVER_SIDE) || + (tb[MPTCP_ATTR_SERVER_SIDE] && rta_getattr_u8(tb[MPTCP_ATTR_SERVER_SIDE]))) { + flags &= ~MPTCP_PM_EV_FLAG_SERVER_SIDE; + printf(" server_side"); + } if (flags & MPTCP_PM_EV_FLAG_DENY_JOIN_ID0) { flags &= ~MPTCP_PM_EV_FLAG_DENY_JOIN_ID0; printf(" deny_join_id0");