From nobody Mon Feb 9 17:05:11 2026 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a50:bae3:0:0:0:0:0 with SMTP id x90csp411163ede; Wed, 16 Mar 2022 12:08:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWsSSkW10oE7Fgj2m/IF0HVF/jT4+bi130Vuu1xKcqpvTZycHV845YW8Xevr0viob1zYBJ X-Received: by 2002:a17:90b:4c43:b0:1bf:8585:9baa with SMTP id np3-20020a17090b4c4300b001bf85859baamr1269128pjb.60.1647457687507; Wed, 16 Mar 2022 12:08:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647457687; cv=none; d=google.com; s=arc-20160816; b=Bu322JwVJXahdTsPGfznCV8xZJPJlV0J3eEa/X2FOxL/uGzQ79eCLW0r4Fl/yU8sYD lx/kHnYz0lAnTN2GAYfza3xF5fIGTAUdNtnyBZHtnm7U8BWLPd36lvB/nT8tzDQyhUMf 4/x5u+aSJaN3oYdxxJJYEfQsQKf9ukyCYVjjqcO3OWSQOvl9Ezs71Gn/tS/axXUXchLl efWFdarWUQlQTSO3i5/1yox25yTdl+5H1kYMVu5aWHoNe5bKt4jIgjwPH7uv9X8cgbGT TSsiCkDwhKFjss4t8M2dUNnU144BZSWcC4aQ/hxDUpnyibAlzCnjuEW91mBAfiOH/E0f L4qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=RRIcUhx9tPpVq1zCtVkJm4h7EDcLBySPOtxnrSGcioo=; b=H80Pnok2eIQ00+uiY+Kg6h8zIkVVgs03+hzw6F0Y0D07LwxUHJcyis/dcKM+nH6qG5 SzOxXwWQD3N/4ORtR8kdaoP5E9Y+2Rd3HSwbtRpZv/ro4wUIShbwm5HMbSrcofut0z9T T++mguF+NDh0MlpENW4/FpK1m5a5DyRKc4265QTsnLN2aisAPJnv4y5aa9fKi0yyaRfY vCHPJ6zyJKp2yEm8uShSHmlmO/ayjGurnSTu4JqzT7GCmIum2NSLKuODNTErHYbiHCmz N7jT34lR7R1vvjanM/ZlLYW0qEY4oCldGlZSosSWK3BIe82Vg+YzFyBicEosO23j4k59 l6eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VDKA4kQP; spf=pass (google.com: domain of mptcp+bounces-4240-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.69.165 as permitted sender) smtp.mailfrom="mptcp+bounces-4240-wpasupplicant.patchew=gmail.com@lists.linux.dev"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sjc.edge.kernel.org (sjc.edge.kernel.org. [147.75.69.165]) by mx.google.com with ESMTPS id u6-20020a170902e80600b00153857e2324si2905205plg.195.2022.03.16.12.08.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Mar 2022 12:08:07 -0700 (PDT) Received-SPF: pass (google.com: domain of mptcp+bounces-4240-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.69.165 as permitted sender) client-ip=147.75.69.165; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VDKA4kQP; spf=pass (google.com: domain of mptcp+bounces-4240-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.69.165 as permitted sender) smtp.mailfrom="mptcp+bounces-4240-wpasupplicant.patchew=gmail.com@lists.linux.dev"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sjc.edge.kernel.org (Postfix) with ESMTPS id 97C153E1002 for ; Wed, 16 Mar 2022 19:08:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 271A23B38; Wed, 16 Mar 2022 19:08:06 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2A00638F5 for ; Wed, 16 Mar 2022 19:08:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1647457684; x=1678993684; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=Dfkdg5YKUEuC4T75Wfo2CDAcejWqGn3fTVKkOtLWEjo=; b=VDKA4kQPFJMQ63s5f08FVNZ/oAAa/kqqap8TXRmulQWpOIsqfPvt/ouM 01myDAqw6jCuyR0OCyrPELGykquwrxP/ysXmPkdYuaYdU076raCr8ZsKA V/BUZxxYamT9dchuhBZTXmW7d6yid1x0AhCk3U2VMw97vEsecpsT3INfl nvTgG64EFHTYxkGtwSAuWaTfGH+vCH8cUxQBdM3tSADGUU4GfsEs7Qh6E eFVVDgSEkVrFvNTm4XMRddcFLNJOGAGgypRl432HDi28GQIaQHDxYUYi6 7aGoToC8hp4caOFna0ZPDStHBF57ibOMe6syScHJKjNLfVzLhnF+EvW6W g==; X-IronPort-AV: E=McAfee;i="6200,9189,10288"; a="255521715" X-IronPort-AV: E=Sophos;i="5.90,187,1643702400"; d="scan'208";a="255521715" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Mar 2022 12:07:58 -0700 X-IronPort-AV: E=Sophos;i="5.90,187,1643702400"; d="scan'208";a="644799818" Received: from otc-tsn-4.jf.intel.com ([10.23.153.135]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Mar 2022 12:07:58 -0700 From: Kishen Maloor To: kishen.maloor@intel.com, mptcp@lists.linux.dev Subject: [PATCH mptcp-next 5/5] mptcp: expose server_side attribute in MPTCP netlink events Date: Wed, 16 Mar 2022 15:07:47 -0400 Message-Id: <20220316190747.634325-6-kishen.maloor@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220316190747.634325-1-kishen.maloor@intel.com> References: <20220316190747.634325-1-kishen.maloor@intel.com> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This change records the 'server_side' attribute of MPTCP_EVENT_CREATED and MPTCP_EVENT_ESTABLISHED events to inform their recipient about the Client/Server role of the running MPTCP application. Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/246 Signed-off-by: Kishen Maloor --- include/uapi/linux/mptcp.h | 1 + net/mptcp/pm_netlink.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/include/uapi/linux/mptcp.h b/include/uapi/linux/mptcp.h index 9690efedb5fa..e41ea01a94bb 100644 --- a/include/uapi/linux/mptcp.h +++ b/include/uapi/linux/mptcp.h @@ -188,6 +188,7 @@ enum mptcp_event_attr { MPTCP_ATTR_IF_IDX, /* s32 */ MPTCP_ATTR_RESET_REASON,/* u32 */ MPTCP_ATTR_RESET_FLAGS, /* u32 */ + MPTCP_ATTR_SERVER_SIDE, /* u8 */ =20 __MPTCP_ATTR_AFTER_LAST }; diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index 905f451ff0f9..6fb84f9c377f 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -1974,6 +1974,9 @@ static int mptcp_event_created(struct sk_buff *skb, if (err) return err; =20 + if (nla_put_u8(skb, MPTCP_ATTR_SERVER_SIDE, READ_ONCE(msk->pm.server_side= ))) + return -EMSGSIZE; + return mptcp_event_add_subflow(skb, ssk); } =20 --=20 2.31.1