From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyrill Gorcunov Subject: Re: [RFC] net: netlink -- Allow netlink_dump to return error code if protocol handler is missed Date: Sat, 3 Nov 2012 20:39:58 +0400 Message-ID: <20121103163958.GB6055@moon> References: <20121102173550.GH10877@moon> <509543AE.1020902@parallels.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: NETDEV , David Miller , Eric Dumazet To: Pavel Emelyanov Return-path: Received: from mail-la0-f46.google.com ([209.85.215.46]:57600 "EHLO mail-la0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756713Ab2KCQkD (ORCPT ); Sat, 3 Nov 2012 12:40:03 -0400 Received: by mail-la0-f46.google.com with SMTP id h6so3234146lag.19 for ; Sat, 03 Nov 2012 09:40:01 -0700 (PDT) Content-Disposition: inline In-Reply-To: <509543AE.1020902@parallels.com> Sender: netdev-owner@vger.kernel.org List-ID: On Sat, Nov 03, 2012 at 08:17:50PM +0400, Pavel Emelyanov wrote: > > static int inet_diag_dump(struct sk_buff *skb, struct netlink_callback *cb) > > Index: linux-2.6.git/net/netlink/af_netlink.c > > =================================================================== > > --- linux-2.6.git.orig/net/netlink/af_netlink.c > > +++ linux-2.6.git/net/netlink/af_netlink.c > > @@ -1740,6 +1740,10 @@ static int netlink_dump(struct sock *sk) > > else > > __netlink_sendskb(sk, skb); > > return 0; > > + } else if (len < 0) { > > + err = len; > > + nlk->cb = NULL; > > + goto errout_skb; > > When family-level handler is absent and sock_diag returns error this error > gets propagated back to user without this fix. Why do we need it in case > we return error from protocol-level handler? Because as far as I can say the family-level handler already has such error returning code in __sock_diag_rcv_msg. Or you mean something else? Cyrill