netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Benc <jbenc@redhat.com>
To: Christophe Ricard <christophe.ricard@gmail.com>
Cc: pablo@netfilter.org, sfeldma@gmail.com, sameo@linux.intel.com,
	davem@davemloft.net, netdev@vger.kernel.org,
	Christophe Ricard <christophe-h.ricard@st.com>,
	stable@vger.kernel.org
Subject: Re: [RFC v2] netlink: add NETLINK_CAP_ACK socket option
Date: Wed, 26 Aug 2015 09:46:49 +0200	[thread overview]
Message-ID: <20150826094649.0f9e3ac6@griffin> (raw)
In-Reply-To: <1440531809-26963-2-git-send-email-christophe-h.ricard@st.com>

On Tue, 25 Aug 2015 21:43:29 +0200, Christophe Ricard wrote:
>  void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err)
>  {
> +	struct netlink_sock *nlk;
>  	struct sk_buff *skb;
>  	struct nlmsghdr *rep;
>  	struct nlmsgerr *errmsg;
>  	size_t payload = sizeof(*errmsg);
> +	struct sock *sk;
>  
> -	/* error messages get the original request appened */
> -	if (err)
> +	sk = netlink_lookup(sock_net(in_skb->sk),
> +			    in_skb->sk->sk_protocol,
> +			    NETLINK_CB(in_skb).portid);

The necessity to look up the socket for every ack was what I didn't
like about this. Would it be possible to add a socket parameter to
various code paths that lead to netlink_ack (or a boolean, as David
suggested)? It will probably be needed to add it to
netlink_sock->netlink_rcv, netlink_kernel_cfg->input, etc.

As an alternative, David also suggested to attach the sender socket to
in_skb->sk. Could work, too.

Thanks,

 Jiri

-- 
Jiri Benc

      reply	other threads:[~2015-08-26  7:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-25 19:43 [RFC v2] netlink_ack: send a capped message in case of error Christophe Ricard
2015-08-25 19:43 ` [RFC v2] netlink: add NETLINK_CAP_ACK socket option Christophe Ricard
2015-08-26  7:46   ` Jiri Benc [this message]

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=20150826094649.0f9e3ac6@griffin \
    --to=jbenc@redhat.com \
    --cc=christophe-h.ricard@st.com \
    --cc=christophe.ricard@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=sameo@linux.intel.com \
    --cc=sfeldma@gmail.com \
    --cc=stable@vger.kernel.org \
    /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).