Commit ac720ea3 authored by Geliang Tang's avatar Geliang Tang
Browse files

mptcp: export mptcp_genl_family & mptcp_nl_fill_addr

mainline inclusion
from mainline-v6.9-rc1
commit 34ca91e15e69917d2dbb6a76fdf8d28c5c7dc05e
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I9VYQ9
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=34ca91e15e69917d2dbb6a76fdf8d28c5c7dc05e



--------------------------------

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: default avatarGeliang Tang <tanggeliang@kylinos.cn>
Reviewed-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
Reviewed-by: default avatarMat Martineau <martineau@kernel.org>
Signed-off-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Change-Id: Ib49a559d4e4b0755d46fa924e0bf7abda09ac116
Reviewed-by: default avatarJackie Liu <liuyun01@kylinos.cn>
Signed-off-by: default avatarGeliang Tang <tanggeliang@kylinos.cn>
parent c736d912
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -18,9 +18,6 @@
#include "protocol.h"
#include "mib.h"

/* forward declaration */
static struct genl_family mptcp_genl_family;

static int pm_nl_pernet_id;

struct mptcp_pm_add_entry {
@@ -1757,7 +1754,7 @@ int mptcp_pm_nl_flush_addrs_doit(struct sk_buff *skb, struct genl_info *info)
	return 0;
}

static int mptcp_nl_fill_addr(struct sk_buff *skb,
int mptcp_nl_fill_addr(struct sk_buff *skb,
		       struct mptcp_pm_addr_entry *entry)
{
	struct mptcp_addr_info *addr = &entry->addr;
@@ -2403,7 +2400,7 @@ void mptcp_event(enum mptcp_event_type type, const struct mptcp_sock *msk,
	nlmsg_free(skb);
}

static struct genl_family mptcp_genl_family __ro_after_init = {
struct genl_family mptcp_genl_family __ro_after_init = {
	.name		= MPTCP_PM_NAME,
	.version	= MPTCP_PM_VER,
	.netnsok	= true,
+4 −0
Original line number Diff line number Diff line
@@ -346,6 +346,8 @@ struct mptcp_sock {
#define mptcp_for_each_subflow_safe(__msk, __subflow, __tmp)			\
	list_for_each_entry_safe(__subflow, __tmp, &((__msk)->conn_list), node)

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);
@@ -1001,6 +1003,8 @@ void __mptcp_fastopen_gen_msk_ackseq(struct mptcp_sock *msk, struct mptcp_subflo
				     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);

static inline bool mptcp_pm_should_add_signal(struct mptcp_sock *msk)
{