From nobody Mon Sep 16 19:08:35 2024 Received: from out-183.mta0.migadu.com (out-183.mta0.migadu.com [91.218.175.183]) (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 46504111A3 for ; Fri, 29 Dec 2023 12:48:41 +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="J06v46CS" 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=1703854119; 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=UL2y88wdaVfD0h78UovmL8ymMx6E5PuCKxgLZns8MqU=; b=J06v46CSnk91TV4zKD2DRhsw7K5HRryc/Ue8H2Gns3cQC4P7iv8cSROzJAcDbAyFJr282e rGwjTDOl8hzCAWfMAwFA/CuZGShtGqNmF0eTLYLPfF18kfYjk4Fb1n/cJclYivXzldr/lC KdDlxS0Vc/Z8T6TW2JJ28QmsIODz38w= From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v6 07/24] mptcp: export mptcp_genl_family & mptcp_nl_fill_addr Date: Fri, 29 Dec 2023 20:47:25 +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" 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 8a311b497603..b777561eeaa0 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 { @@ -1631,8 +1628,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; @@ -2276,7 +2273,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 f7b9c1b995df..9b0b3fa65ae5 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); @@ -961,6 +963,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.39.2