Subject: Re: [PATCH] netlink: invert error code in netlink_set_err()

From: Patrick McHardy <[email-masked]>
Date: Wed, 04 Mar 2009 11:13:50 +0100

Pablo Neira Ayuso wrote:
> The callers of netlink_set_err() currently pass a negative value
> as parameter for the error code. However, sk->sk_err wants a
> positive error value. Without this patch, skb_recv_datagram() called
> by netlink_recvmsg() may return a positive value to report an error.
> 
> Another choice to fix this is to change callers to pass a positive
> error value, but this seems a bit inconsistent and error prone
> to me. Indeed, the callers of netlink_set_err() assumed that the
> (usual) negative value for error codes was fine before this patch :).

Amazing how this kept hidden for so long. I could have sworn I've
already seen the notification errors in userspace :)