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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to