All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Xin Long <lucien.xin@gmail.com>
Cc: network dev <netdev@vger.kernel.org>,
	linux-sctp@vger.kernel.org, Vlad Yasevich <vyasevich@gmail.com>,
	daniel@iogearbox.net, davem@davemloft.net
Subject: Re: [PATCH net-next 3/7] sctp: export some functions for sctp_diag in inet_diag
Date: Thu, 07 Apr 2016 18:17:16 +0000	[thread overview]
Message-ID: <20160407181716.GE15005@localhost.localdomain> (raw)
In-Reply-To: <d16e3f12f689f28d8c3b62c7c2a15916177bd7c0.1459829123.git.lucien.xin@gmail.com>

On Tue, Apr 05, 2016 at 12:06:28PM +0800, Xin Long wrote:
> inet_diag_msg_common_fill is used to fill the diag msg common info,
> we need to use it in sctp_diag as well, so export it.
> 
> We also add inet_diag_get_handler() to access inet_diag_table in sctp
> diag.
> 
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
> ---
>  net/ipv4/inet_diag.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
> index bd591eb..29121a6 100644
> --- a/net/ipv4/inet_diag.c
> +++ b/net/ipv4/inet_diag.c
> @@ -66,7 +66,13 @@ static void inet_diag_unlock_handler(const struct inet_diag_handler *handler)
>  	mutex_unlock(&inet_diag_table_mutex);
>  }
>  
> -static void inet_diag_msg_common_fill(struct inet_diag_msg *r, struct sock *sk)
> +struct inet_diag_handler *inet_diag_get_handler(int proto)

It needs to return it as const, as inet_diag_table is also declared as
const, so we don't loose the qualifier.

> +{
> +	return inet_diag_table[proto];
> +}
> +EXPORT_SYMBOL_GPL(inet_diag_get_handler);
> +
> +void inet_diag_msg_common_fill(struct inet_diag_msg *r, struct sock *sk)
>  {
>  	r->idiag_family = sk->sk_family;
>  
> @@ -89,6 +95,7 @@ static void inet_diag_msg_common_fill(struct inet_diag_msg *r, struct sock *sk)
>  	r->id.idiag_dst[0] = sk->sk_daddr;
>  	}
>  }
> +EXPORT_SYMBOL_GPL(inet_diag_msg_common_fill);
>  
>  static size_t inet_sk_attr_size(void)
>  {
> -- 
> 2.1.0
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

WARNING: multiple messages have this Message-ID (diff)
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Xin Long <lucien.xin@gmail.com>
Cc: network dev <netdev@vger.kernel.org>,
	linux-sctp@vger.kernel.org, Vlad Yasevich <vyasevich@gmail.com>,
	daniel@iogearbox.net, davem@davemloft.net
Subject: Re: [PATCH net-next 3/7] sctp: export some functions for sctp_diag in inet_diag
Date: Thu, 7 Apr 2016 15:17:16 -0300	[thread overview]
Message-ID: <20160407181716.GE15005@localhost.localdomain> (raw)
In-Reply-To: <d16e3f12f689f28d8c3b62c7c2a15916177bd7c0.1459829123.git.lucien.xin@gmail.com>

On Tue, Apr 05, 2016 at 12:06:28PM +0800, Xin Long wrote:
> inet_diag_msg_common_fill is used to fill the diag msg common info,
> we need to use it in sctp_diag as well, so export it.
> 
> We also add inet_diag_get_handler() to access inet_diag_table in sctp
> diag.
> 
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
> ---
>  net/ipv4/inet_diag.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
> index bd591eb..29121a6 100644
> --- a/net/ipv4/inet_diag.c
> +++ b/net/ipv4/inet_diag.c
> @@ -66,7 +66,13 @@ static void inet_diag_unlock_handler(const struct inet_diag_handler *handler)
>  	mutex_unlock(&inet_diag_table_mutex);
>  }
>  
> -static void inet_diag_msg_common_fill(struct inet_diag_msg *r, struct sock *sk)
> +struct inet_diag_handler *inet_diag_get_handler(int proto)

It needs to return it as const, as inet_diag_table is also declared as
const, so we don't loose the qualifier.

> +{
> +	return inet_diag_table[proto];
> +}
> +EXPORT_SYMBOL_GPL(inet_diag_get_handler);
> +
> +void inet_diag_msg_common_fill(struct inet_diag_msg *r, struct sock *sk)
>  {
>  	r->idiag_family = sk->sk_family;
>  
> @@ -89,6 +95,7 @@ static void inet_diag_msg_common_fill(struct inet_diag_msg *r, struct sock *sk)
>  	r->id.idiag_dst[0] = sk->sk_daddr;
>  	}
>  }
> +EXPORT_SYMBOL_GPL(inet_diag_msg_common_fill);
>  
>  static size_t inet_sk_attr_size(void)
>  {
> -- 
> 2.1.0
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

  parent reply	other threads:[~2016-04-07 18:17 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-05  4:06 [PATCH net-next 0/7] sctp: support sctp_diag in kernel Xin Long
2016-04-05  4:06 ` Xin Long
2016-04-05  4:06 ` [PATCH net-next 1/7] sctp: add sctp_info dump api for sctp_diag Xin Long
2016-04-05  4:06   ` Xin Long
2016-04-05  4:06   ` [PATCH net-next 2/7] sctp: export some apis or variables " Xin Long
2016-04-05  4:06     ` Xin Long
2016-04-05  4:06     ` [PATCH net-next 3/7] sctp: export some functions for sctp_diag in inet_diag Xin Long
2016-04-05  4:06       ` Xin Long
2016-04-05  4:06       ` [PATCH net-next 4/7] sctp: add the sctp_diag.c file Xin Long
2016-04-05  4:06         ` Xin Long
2016-04-05  4:06         ` [PATCH net-next 5/7] sctp: reuse the some transport traversal functions in proc Xin Long
2016-04-05  4:06           ` Xin Long
2016-04-05  4:06           ` [PATCH net-next 6/7] sctp: merge the seq_start/next/exits in remaddrs and assocs Xin Long
2016-04-05  4:06             ` Xin Long
2016-04-05  4:06             ` [PATCH net-next 7/7] sctp: fix some rhashtable functions using in sctp proc/diag Xin Long
2016-04-05  4:06               ` Xin Long
2016-04-07 13:09           ` [PATCH net-next 5/7] sctp: reuse the some transport traversal functions in proc Neil Horman
2016-04-07 13:09             ` Neil Horman
2016-04-07 18:29             ` Marcelo Ricardo Leitner
2016-04-07 18:29               ` Marcelo Ricardo Leitner
2016-04-07 18:17       ` Marcelo Ricardo Leitner [this message]
2016-04-07 18:17         ` [PATCH net-next 3/7] sctp: export some functions for sctp_diag in inet_diag Marcelo Ricardo Leitner
2016-04-06 20:13 ` [PATCH net-next 0/7] sctp: support sctp_diag in kernel David Miller
2016-04-06 20:13   ` David Miller
2016-04-06 21:42   ` marcelo.leitner
2016-04-06 21:42     ` marcelo.leitner
2016-04-07 18:34 ` Marcelo Ricardo Leitner
2016-04-07 18:34   ` Marcelo Ricardo Leitner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160407181716.GE15005@localhost.localdomain \
    --to=marcelo.leitner@gmail.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=linux-sctp@vger.kernel.org \
    --cc=lucien.xin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=vyasevich@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.