[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150826094649.0f9e3ac6@griffin>
Date: Wed, 26 Aug 2015 09:46:49 +0200
From: Jiri Benc <jbenc@...hat.com>
To: Christophe Ricard <christophe.ricard@...il.com>
Cc: pablo@...filter.org, sfeldma@...il.com, sameo@...ux.intel.com,
davem@...emloft.net, netdev@...r.kernel.org,
Christophe Ricard <christophe-h.ricard@...com>,
stable@...r.kernel.org
Subject: Re: [RFC v2] netlink: add NETLINK_CAP_ACK socket option
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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists