public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Vadim Kochan <vadim4j@gmail•com>
To: Eric Dumazet <eric.dumazet@gmail•com>
Cc: Miha Marolt <miham@beyondsemi•com>,
	netdev@vger•kernel.org, Vadim Kochan <vadim4j@gmail•com>
Subject: Re: [BUG] "$ ss -a" incorrectly displays raw sockets as udp sockets
Date: Thu, 9 Jul 2015 18:28:04 +0300	[thread overview]
Message-ID: <20150709152804.GA16132@angus-think.lan> (raw)
In-Reply-To: <1436455270.24939.32.camel@edumazet-glaptop2.roam.corp.google.com>

On Thu, Jul 09, 2015 at 05:21:10PM +0200, Eric Dumazet wrote:
> On Thu, 2015-07-09 at 17:14 +0200, Eric Dumazet wrote:
> 
> > 
> > If I checkout iproute2 tree to db08bdb816d337102c5486744008db9c9faa43bf
> > (before buggy commit) we indeed had this result :
> > 
> > # ./ss -an | grep 127.0.0.1
> > raw    UNCONN     213486 0      127.0.0.1:6                     *:*                  
> 
> Maybe following patch would fix the issue.
> 
> diff --git a/misc/ss.c b/misc/ss.c
> index 03f92fa69270..9b7dad00290c 100644
> --- a/misc/ss.c
> +++ b/misc/ss.c
> @@ -1552,6 +1552,8 @@ out:
>  static char *proto_name(int protocol)
>  {
>  	switch (protocol) {
> +	case 0:
> +		return "raw";
>  	case IPPROTO_UDP:
>  		return "udp";
>  	case IPPROTO_TCP:
> @@ -2416,7 +2418,7 @@ static int dgram_show_line(char *line, const struct filter *f, int family)
>  	if (n < 9)
>  		opt[0] = 0;
>  
> -	inet_stats_print(&s, IPPROTO_UDP);
> +	inet_stats_print(&s, 0);
>  
>  	if (show_details && opt[0])
>  		printf(" opt:\"%s\"", opt);
> 
> 

Yes, it fixes the issue too.

  reply	other threads:[~2015-07-09 15:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-09 14:13 [BUG] "$ ss -a" incorrectly displays raw sockets as udp sockets Miha Marolt
2015-07-09 14:50 ` Nikolay Aleksandrov
2015-07-09 14:55   ` Vadim Kochan
2015-07-09 14:57     ` Nikolay Aleksandrov
2015-07-09 15:09       ` Miha Marolt
2015-07-09 15:15         ` Vadim Kochan
2015-07-10  7:09           ` Miha Marolt
2015-07-10  7:16             ` Vadim Kochan
2015-07-15 12:10               ` Miha Marolt
2015-07-15 12:50                 ` [PATCH iproute2] ss: fix display of raw sockets Nikolay Aleksandrov
2015-07-20 21:58                   ` Stephen Hemminger
2015-07-09 15:14 ` [BUG] "$ ss -a" incorrectly displays raw sockets as udp sockets Eric Dumazet
2015-07-09 15:21   ` Eric Dumazet
2015-07-09 15:28     ` Vadim Kochan [this message]
2015-07-09 15:30       ` Nikolay Aleksandrov

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=20150709152804.GA16132@angus-think.lan \
    --to=vadim4j@gmail$(echo .)com \
    --cc=eric.dumazet@gmail$(echo .)com \
    --cc=miham@beyondsemi$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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