From: Eugene Syromiatnikov <esyr@redhat.com>
To: Ursula Braun <ubraun@linux.ibm.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
linux-s390@vger.kernel.org, schwidefsky@de.ibm.com,
heiko.carstens@de.ibm.com, raspl@linux.ibm.com,
kgraul@linux.ibm.com
Subject: Re: [net-next,v2,2/4] net/smc: ipv6 support for smc_diag.c
Date: Sat, 13 Oct 2018 05:45:30 +0200 [thread overview]
Message-ID: <20181013034530.GH21972@asgard.redhat.com> (raw)
In-Reply-To: <3cb67163-53c6-dd63-71b6-d34581918708@linux.ibm.com>
On Tue, Oct 09, 2018 at 04:41:43PM +0200, Ursula Braun wrote:
> Eugene,
>
> we are considering the following patch:
>
> ---
> net/smc/smc_diag.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/net/smc/smc_diag.c b/net/smc/smc_diag.c
> index dbf64a93d68a..371b4cf31fcd 100644
> --- a/net/smc/smc_diag.c
> +++ b/net/smc/smc_diag.c
> @@ -38,6 +38,7 @@ static void smc_diag_msg_common_fill(struct smc_diag_msg *r, struct sock *sk)
> {
> struct smc_sock *smc = smc_sk(sk);
>
> + r->diag_family = sk->sk_family;
> if (!smc->clcsock)
> return;
> r->id.idiag_sport = htons(smc->clcsock->sk->sk_num);
> @@ -45,14 +46,12 @@ static void smc_diag_msg_common_fill(struct smc_diag_msg *r, struct sock *sk)
> r->id.idiag_if = smc->clcsock->sk->sk_bound_dev_if;
> sock_diag_save_cookie(sk, r->id.idiag_cookie);
> if (sk->sk_protocol == SMCPROTO_SMC) {
> - r->diag_family = PF_INET;
> memset(&r->id.idiag_src, 0, sizeof(r->id.idiag_src));
> memset(&r->id.idiag_dst, 0, sizeof(r->id.idiag_dst));
> r->id.idiag_src[0] = smc->clcsock->sk->sk_rcv_saddr;
> r->id.idiag_dst[0] = smc->clcsock->sk->sk_daddr;
> #if IS_ENABLED(CONFIG_IPV6)
> } else if (sk->sk_protocol == SMCPROTO_SMC6) {
> - r->diag_family = PF_INET6;
> memcpy(&r->id.idiag_src, &smc->clcsock->sk->sk_v6_rcv_saddr,
> sizeof(smc->clcsock->sk->sk_v6_rcv_saddr));
> memcpy(&r->id.idiag_dst, &smc->clcsock->sk->sk_v6_daddr,
> --
>
> Tools would then need to derive the PF_INET/PF_INET6 info from the inet_diag_sockid info
> in the smc_diag_msg.
Unfortunately, struct inet_diag_sockid doesn't provide any clue
in order to derive address family.
There's unused (if I haven't missed anything) diag_shutdown field
in struct smc_diag_msg (it looks like that the shutdown state is
reported via a separate attribute in the current implementation),
it probably might be repurposed for providing information about
the underlying socket address family.
> However, this problem is in the mainline kernel since 4.18. So, we are not sure if we are allowed
> to change the user interface again.
Well, anything is better that the current state.
next prev parent reply other threads:[~2018-10-13 11:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-02 14:56 [PATCH net-next v2 0/4] net/smc: small features 2018/04/30 Ursula Braun
2018-05-02 14:56 ` [PATCH net-next v2 1/4] net/smc: periodic testlink support Ursula Braun
2018-05-02 14:56 ` [PATCH net-next v2 2/4] net/smc: ipv6 support for smc_diag.c Ursula Braun
2018-10-07 1:11 ` [net-next,v2,2/4] " Eugene Syromiatnikov
2018-10-09 14:41 ` Ursula Braun
2018-10-13 3:45 ` Eugene Syromiatnikov [this message]
2018-05-02 14:56 ` [PATCH net-next v2 3/4] net/smc: handle ioctls SIOCINQ, SIOCOUTQ, and SIOCOUTQNSD Ursula Braun
2018-05-02 14:56 ` [PATCH net-next v2 4/4] net/smc: determine vlan_id of stacked net_device Ursula Braun
2018-05-02 17:30 ` [PATCH net-next v2 0/4] net/smc: small features 2018/04/30 David Miller
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=20181013034530.GH21972@asgard.redhat.com \
--to=esyr@redhat.com \
--cc=davem@davemloft.net \
--cc=heiko.carstens@de.ibm.com \
--cc=kgraul@linux.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=raspl@linux.ibm.com \
--cc=schwidefsky@de.ibm.com \
--cc=ubraun@linux.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).