From nobody Mon Sep 16 18:59:08 2024 Received: from out-176.mta1.migadu.com (out-176.mta1.migadu.com [95.215.58.176]) (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 B97C5747C for ; Tue, 16 Jan 2024 03:35:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="gQYZRo3H" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1705376136; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ksbg1scngvCeqeLQJLPBTkeZOfko7qWFLm4HaAzzTBo=; b=gQYZRo3HsQy19ZJieQ1ines81q+bPicx8YNr3Jwh+TUa8gQW4YNgUDQI6dW7PQ1Jrpd6LJ Oe9+FvjSNOIMLTLZ5wXdtQuTItQ0S2PeR3eyBW3y9qqYbbI6jz5NXGvJokoCRi4nlnfF4V p38zxAE2IwFUYLIqiCgA+aZ9u1WKHLg= From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v9 06/23] mptcp: export mptcp_genl_family & mptcp_nl_fill_addr Date: Tue, 16 Jan 2024 11:34:54 +0800 Message-Id: In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Geliang Tang This patch exports struct mptcp_genl_family and mptcp_nl_fill_addr() helper to allow them can be used in pm_userspace.c. Signed-off-by: Geliang Tang --- net/mptcp/pm_netlink.c | 9 +++------ net/mptcp/protocol.h | 4 ++++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index d158bfab1abc..1c3091fc4e1d 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -18,9 +18,6 @@ #include "protocol.h" #include "mib.h" =20 -/* forward declaration */ -static struct genl_family mptcp_genl_family; - static int pm_nl_pernet_id; =20 struct mptcp_pm_add_entry { @@ -1621,8 +1618,8 @@ int mptcp_pm_nl_flush_addrs_doit(struct sk_buff *skb,= struct genl_info *info) return 0; } =20 -static int mptcp_nl_fill_addr(struct sk_buff *skb, - struct mptcp_pm_addr_entry *entry) +int mptcp_nl_fill_addr(struct sk_buff *skb, + struct mptcp_pm_addr_entry *entry) { struct mptcp_addr_info *addr =3D &entry->addr; struct nlattr *attr; @@ -2266,7 +2263,7 @@ void mptcp_event(enum mptcp_event_type type, const st= ruct mptcp_sock *msk, nlmsg_free(skb); } =20 -static struct genl_family mptcp_genl_family __ro_after_init =3D { +struct genl_family mptcp_genl_family __ro_after_init =3D { .name =3D MPTCP_PM_NAME, .version =3D MPTCP_PM_VER, .netnsok =3D true, diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index def791ce751b..271ddbff87de 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -341,6 +341,8 @@ struct mptcp_sock { #define mptcp_for_each_subflow_safe(__msk, __subflow, __tmp) \ list_for_each_entry_safe(__subflow, __tmp, &((__msk)->conn_list), node) =20 +extern struct genl_family mptcp_genl_family; + static inline void msk_owned_by_me(const struct mptcp_sock *msk) { sock_owned_by_me((const struct sock *)msk); @@ -963,6 +965,8 @@ void mptcp_fastopen_gen_msk_ackseq(struct mptcp_sock *m= sk, struct mptcp_subflow_ const struct mptcp_options_received *mp_opt); void mptcp_fastopen_subflow_synack_set_params(struct mptcp_subflow_context= *subflow, struct request_sock *req); +int mptcp_nl_fill_addr(struct sk_buff *skb, + struct mptcp_pm_addr_entry *entry); =20 static inline bool mptcp_pm_should_add_signal(struct mptcp_sock *msk) { --=20 2.40.1