netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: vadim4j@gmail.com
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH iproute2] ss: Use rtnl_dump_filter in handle_netlink_request
Date: Thu, 4 Dec 2014 01:28:19 +0200	[thread overview]
Message-ID: <20141203232819.GA12656@angus-think.lan> (raw)
In-Reply-To: <20141203150748.001d481e@urahara>

On Wed, Dec 03, 2014 at 03:07:48PM -0800, Stephen Hemminger wrote:
> On Thu, 4 Dec 2014 00:15:54 +0200
> Vadim Kochan <vadim4j@gmail.com> wrote:
> 
> > I established some simple OpenVPN connection (at least by the logs and
> > ss I see that peer is connected), but
> > I dont get any errors with ss.
> > 
> > So can you please provide some more info how did you tested this patch
> > ? I am surprised that this is caused only
> > by these changes ...
> > 
> > On Wed, Dec 3, 2014 at 7:45 PM,  <vadim4j@gmail.com> wrote:
> > > On Wed, Dec 03, 2014 at 09:51:23AM -0800, Stephen Hemminger wrote:
> > >> On Wed, 3 Dec 2014 19:20:10 +0200
> > >> vadim4j@gmail.com wrote:
> > >>
> > >> > On Wed, Dec 03, 2014 at 09:21:29AM -0800, Stephen Hemminger wrote:
> > >> > > On Tue,  2 Dec 2014 16:53:04 +0200
> > >> > > Vadim Kochan <vadim4j@gmail.com> wrote:
> > >> > >
> > >> > > > Replaced handling netlink messages by rtnl_dump_filter
> > >> > > > from lib/libnetlink.c, also:
> > >> > > >
> > >> > > >     - removed unused dump_fp arg;
> > >> > > >     - added MAGIC_SEQ #define for 123456 seq id
> > >> > > >
> > >> > > > Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
> > >> > >
> > >> > > This doesn't work correctly.
> > >> > >
> > >> > > Simple test
> > >> > >   $ misc/ss >/dev/null
> > >> > > RTNETLINK answers: No such file or directory
> > >> > > RTNETLINK answers: No such file or directory
> > >> > > RTNETLINK answers: No such file or directory
> > >> >
> > >> > Just tried, I did not get such errors.
> > >>
> > >> I have OpenVPN running.
> > >
> > > Hm, it is reproduced only with this patch ?
> > > If so I will try to setup OpenVPN ... can't imagine how it can be
> > > related ...
> 
> I am running on 3.17.4 kernel if that helps.

OK, thank you!

I see a reason why it was caused by this patch. So the difference is in
the way how the libnetlink/rtnl_* and original ss.c handles the
NLMSG_ERROR, ss.c netlink handler checks errno ENOENT (No such file or directory)
and silently closes file end returns -1, but rtnl_* prints the error message.

Meanwhile I dont know the real reason why ENOENT error is happaned, may
be it is OK in context of diagnostic messages. But I grepped over the
commits and found that this ENOENT checking was added by Eric in:

    commit a3fd8e58c1787af186f5c4b234ff974544f840b6
    Author: Eric Dumazet <eric.dumazet@gmail.com>
    Date:   Mon Jan 30 17:05:45 2012 +0100

    ss: should support CONFIG_INET_UDP_DIAG=n kernels

    ss -x currently fails if CONFIG_INET_UDP_DIAG=n or old kernels

    Also close file descriptors while we are at it.

    Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
    Cc: Pavel Emelyanov <xemul@parallels.com>

  reply	other threads:[~2014-12-03 23:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-02 14:53 [PATCH iproute2] ss: Use rtnl_dump_filter in handle_netlink_request Vadim Kochan
2014-12-03 17:21 ` Stephen Hemminger
2014-12-03 17:20   ` vadim4j
2014-12-03 17:51     ` Stephen Hemminger
2014-12-03 17:45       ` vadim4j
2014-12-03 22:15         ` Vadim Kochan
2014-12-03 23:07           ` Stephen Hemminger
2014-12-03 23:28             ` vadim4j [this message]
2014-12-04  0:00               ` Vadim Kochan

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=20141203232819.GA12656@angus-think.lan \
    --to=vadim4j@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).