Re: [RFC v2] netlink: add NETLINK_CAP_ACK socket option
From: Jiri Benc <hidden>
Date: 2015-08-26 07:46:54
Also in:
stable
From: Jiri Benc <hidden>
Date: 2015-08-26 07:46:54
Also in:
stable
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