All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@openvz.org>
To: Pavel Emelyanov <xemul@parallels.com>
Cc: NETDEV <netdev@vger.kernel.org>,
	David Miller <davem@davemloft.net>,
	Eric Dumazet <eric.dumazet@gmail.com>
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	[thread overview]
Message-ID: <20121103163958.GB6055@moon> (raw)
In-Reply-To: <509543AE.1020902@parallels.com>

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

  reply	other threads:[~2012-11-03 16:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-02 17:35 [RFC] net: netlink -- Allow netlink_dump to return error code if protocol handler is missed Cyrill Gorcunov
2012-11-03 16:17 ` Pavel Emelyanov
2012-11-03 16:39   ` Cyrill Gorcunov [this message]
2012-11-03 19:16     ` Cyrill Gorcunov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121103163958.GB6055@moon \
    --to=gorcunov@openvz.org \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=xemul@parallels.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.