All of lore.kernel.org
 help / color / mirror / Atom feed
* Commit 8ef874bfc7296fa206eea2ad1e8a426f576bf6f6 has broken ss command
@ 2012-04-04  9:03 Kusanagi Kouichi
  2012-04-04  9:07 ` Eric Dumazet
  2012-04-04  9:25 ` David Miller
  0 siblings, 2 replies; 9+ messages in thread
From: Kusanagi Kouichi @ 2012-04-04  9:03 UTC (permalink / raw)
  To: netdev; +Cc: Pavel Emelyanov, linux-kernel

Since commit 8ef874bfc7296fa206eea2ad1e8a426f576bf6f6 ("sock_diag:
Move the sock_ code to net/core/"), ss command from iproute package
doesn't work if INET_DIAG is not enabled.

$ ss
State       Recv-Q Send-Q                                             Local Address:Port                                                 Peer Address:Port
TCPDIAG answers: Operation not supported

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Commit 8ef874bfc7296fa206eea2ad1e8a426f576bf6f6 has broken ss command
  2012-04-04  9:03 Commit 8ef874bfc7296fa206eea2ad1e8a426f576bf6f6 has broken ss command Kusanagi Kouichi
@ 2012-04-04  9:07 ` Eric Dumazet
  2012-04-04  9:24   ` David Miller
  2012-04-04 10:00   ` Kusanagi Kouichi
  2012-04-04  9:25 ` David Miller
  1 sibling, 2 replies; 9+ messages in thread
From: Eric Dumazet @ 2012-04-04  9:07 UTC (permalink / raw)
  To: Kusanagi Kouichi; +Cc: netdev, Pavel Emelyanov, linux-kernel

On Wed, 2012-04-04 at 18:03 +0900, Kusanagi Kouichi wrote:
> Since commit 8ef874bfc7296fa206eea2ad1e8a426f576bf6f6 ("sock_diag:
> Move the sock_ code to net/core/"), ss command from iproute package
> doesn't work if INET_DIAG is not enabled.
> 
> $ ss
> State       Recv-Q Send-Q                                             Local Address:Port                                                 Peer Address:Port
> TCPDIAG answers: Operation not supported
> --

Try to update your iproute2 package ?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Commit 8ef874bfc7296fa206eea2ad1e8a426f576bf6f6 has broken ss command
  2012-04-04  9:07 ` Eric Dumazet
@ 2012-04-04  9:24   ` David Miller
  2012-04-04  9:44     ` Eric Dumazet
  2012-04-04 10:00   ` Kusanagi Kouichi
  1 sibling, 1 reply; 9+ messages in thread
From: David Miller @ 2012-04-04  9:24 UTC (permalink / raw)
  To: eric.dumazet; +Cc: slash, netdev, xemul, linux-kernel

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 04 Apr 2012 11:07:43 +0200

> On Wed, 2012-04-04 at 18:03 +0900, Kusanagi Kouichi wrote:
>> Since commit 8ef874bfc7296fa206eea2ad1e8a426f576bf6f6 ("sock_diag:
>> Move the sock_ code to net/core/"), ss command from iproute package
>> doesn't work if INET_DIAG is not enabled.
>> 
>> $ ss
>> State       Recv-Q Send-Q                                             Local Address:Port                                                 Peer Address:Port
>> TCPDIAG answers: Operation not supported
>> --
> 
> Try to update your iproute2 package ?

Well, he doesn't INET_DIAG enabled in his kernel, so no matter what
iproute2 version he uses it won't work :-)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Commit 8ef874bfc7296fa206eea2ad1e8a426f576bf6f6 has broken ss command
  2012-04-04  9:03 Commit 8ef874bfc7296fa206eea2ad1e8a426f576bf6f6 has broken ss command Kusanagi Kouichi
  2012-04-04  9:07 ` Eric Dumazet
@ 2012-04-04  9:25 ` David Miller
  1 sibling, 0 replies; 9+ messages in thread
From: David Miller @ 2012-04-04  9:25 UTC (permalink / raw)
  To: slash; +Cc: netdev, xemul, linux-kernel

From: Kusanagi Kouichi <slash@ac.auone-net.jp>
Date: Wed, 4 Apr 2012 18:03:11 +0900

> Since commit 8ef874bfc7296fa206eea2ad1e8a426f576bf6f6 ("sock_diag:
> Move the sock_ code to net/core/"), ss command from iproute package
> doesn't work if INET_DIAG is not enabled.

Well, of course you need to enable that Kconfig options to get
netlink socket dumping support for inet protocols.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Commit 8ef874bfc7296fa206eea2ad1e8a426f576bf6f6 has broken ss command
  2012-04-04  9:24   ` David Miller
@ 2012-04-04  9:44     ` Eric Dumazet
  2012-04-04  9:48       ` Eric Dumazet
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Dumazet @ 2012-04-04  9:44 UTC (permalink / raw)
  To: David Miller; +Cc: slash, netdev, xemul, linux-kernel

On Wed, 2012-04-04 at 05:24 -0400, David Miller wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Wed, 04 Apr 2012 11:07:43 +0200
> 
> > On Wed, 2012-04-04 at 18:03 +0900, Kusanagi Kouichi wrote:
> >> Since commit 8ef874bfc7296fa206eea2ad1e8a426f576bf6f6 ("sock_diag:
> >> Move the sock_ code to net/core/"), ss command from iproute package
> >> doesn't work if INET_DIAG is not enabled.
> >> 
> >> $ ss
> >> State       Recv-Q Send-Q                                             Local Address:Port                                                 Peer Address:Port
> >> TCPDIAG answers: Operation not supported
> >> --
> > 
> > Try to update your iproute2 package ?
> 
> Well, he doesn't INET_DIAG enabled in his kernel, so no matter what
> iproute2 version he uses it won't work :-)

iproute2 misc/ss.c has a fallback using /proc/net/tcp

Dont know when this broke.

I guess we should fix ss to cope INET_DIAG being disabled.

tcp_show_netlink() should return -1 instead of 0

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Commit 8ef874bfc7296fa206eea2ad1e8a426f576bf6f6 has broken ss command
  2012-04-04  9:44     ` Eric Dumazet
@ 2012-04-04  9:48       ` Eric Dumazet
  0 siblings, 0 replies; 9+ messages in thread
From: Eric Dumazet @ 2012-04-04  9:48 UTC (permalink / raw)
  To: David Miller; +Cc: slash, netdev, xemul, linux-kernel

On Wed, 2012-04-04 at 11:44 +0200, Eric Dumazet wrote:
> On Wed, 2012-04-04 at 05:24 -0400, David Miller wrote:
> > From: Eric Dumazet <eric.dumazet@gmail.com>
> > Date: Wed, 04 Apr 2012 11:07:43 +0200
> > 
> > > On Wed, 2012-04-04 at 18:03 +0900, Kusanagi Kouichi wrote:
> > >> Since commit 8ef874bfc7296fa206eea2ad1e8a426f576bf6f6 ("sock_diag:
> > >> Move the sock_ code to net/core/"), ss command from iproute package
> > >> doesn't work if INET_DIAG is not enabled.
> > >> 
> > >> $ ss
> > >> State       Recv-Q Send-Q                                             Local Address:Port                                                 Peer Address:Port
> > >> TCPDIAG answers: Operation not supported
> > >> --
> > > 
> > > Try to update your iproute2 package ?
> > 
> > Well, he doesn't INET_DIAG enabled in his kernel, so no matter what
> > iproute2 version he uses it won't work :-)
> 
> iproute2 misc/ss.c has a fallback using /proc/net/tcp
> 
> Dont know when this broke.
> 
> I guess we should fix ss to cope INET_DIAG being disabled.
> 
> tcp_show_netlink() should return -1 instead of 0
> 

Kusanagi Kouichi is right. Commit 8ef874bfc72 apparently changed things
since socket(AF_NETLINK, SOCK_RAW, NETINK_INET_DIAG) doesnt fail
anymore...

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Commit 8ef874bfc7296fa206eea2ad1e8a426f576bf6f6 has broken ss command
  2012-04-04  9:07 ` Eric Dumazet
  2012-04-04  9:24   ` David Miller
@ 2012-04-04 10:00   ` Kusanagi Kouichi
  2012-04-04 10:21     ` Eric Dumazet
  1 sibling, 1 reply; 9+ messages in thread
From: Kusanagi Kouichi @ 2012-04-04 10:00 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: netdev, Pavel Emelyanov, linux-kernel

On 2012-04-04 11:07:43 +0200, Eric Dumazet wrote:
> On Wed, 2012-04-04 at 18:03 +0900, Kusanagi Kouichi wrote:
> > Since commit 8ef874bfc7296fa206eea2ad1e8a426f576bf6f6 ("sock_diag:
> > Move the sock_ code to net/core/"), ss command from iproute package
> > doesn't work if INET_DIAG is not enabled.
> > 
> > $ ss
> > State       Recv-Q Send-Q                                             Local Address:Port                                                 Peer Address:Port
> > TCPDIAG answers: Operation not supported
> > --
> 
> Try to update your iproute2 package ?

iproute seems up to date.
$ ss --version
ss utility, iproute2-ss120319

I tried git master commit 4bb00cd2b7525ad7d6cf6bbea945ad6e546873f4.
It still fails.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Commit 8ef874bfc7296fa206eea2ad1e8a426f576bf6f6 has broken ss command
  2012-04-04 10:00   ` Kusanagi Kouichi
@ 2012-04-04 10:21     ` Eric Dumazet
  2012-04-04 13:22       ` Kusanagi Kouichi
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Dumazet @ 2012-04-04 10:21 UTC (permalink / raw)
  To: Kusanagi Kouichi; +Cc: netdev, Pavel Emelyanov, linux-kernel

On Wed, 2012-04-04 at 19:00 +0900, Kusanagi Kouichi wrote:
> On 2012-04-04 11:07:43 +0200, Eric Dumazet wrote:
> > On Wed, 2012-04-04 at 18:03 +0900, Kusanagi Kouichi wrote:
> > > Since commit 8ef874bfc7296fa206eea2ad1e8a426f576bf6f6 ("sock_diag:
> > > Move the sock_ code to net/core/"), ss command from iproute package
> > > doesn't work if INET_DIAG is not enabled.
> > > 
> > > $ ss
> > > State       Recv-Q Send-Q                                             Local Address:Port                                                 Peer Address:Port
> > > TCPDIAG answers: Operation not supported
> > > --
> > 
> > Try to update your iproute2 package ?
> 
> iproute seems up to date.
> $ ss --version
> ss utility, iproute2-ss120319
> 
> I tried git master commit 4bb00cd2b7525ad7d6cf6bbea945ad6e546873f4.
> It still fails.

Please try this patch :

diff --git a/misc/ss.c b/misc/ss.c
index 5414f75..8c00760 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -1534,8 +1534,10 @@ static int tcp_show_netlink(struct filter *f, FILE *dump_fp, int socktype)
 		.msg_iovlen = f->f ? 3 : 1,
 	};
 
-	if (sendmsg(fd, &msg, 0) < 0)
+	if (sendmsg(fd, &msg, 0) < 0) {
+		close(fd);
 		return -1;
+	}
 
 	iov[0] = (struct iovec){
 		.iov_base = buf,
@@ -1589,6 +1591,10 @@ static int tcp_show_netlink(struct filter *f, FILE *dump_fp, int socktype)
 					fprintf(stderr, "ERROR truncated\n");
 				} else {
 					errno = -err->error;
+					if (errno == EOPNOTSUPP) {
+						close(fd);
+						return -1;
+					}
 					perror("TCPDIAG answers");
 				}
 				close(fd);

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: Commit 8ef874bfc7296fa206eea2ad1e8a426f576bf6f6 has broken ss command
  2012-04-04 10:21     ` Eric Dumazet
@ 2012-04-04 13:22       ` Kusanagi Kouichi
  0 siblings, 0 replies; 9+ messages in thread
From: Kusanagi Kouichi @ 2012-04-04 13:22 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: netdev, Pavel Emelyanov, linux-kernel

On 2012-04-04 12:21:17 +0200, Eric Dumazet wrote:
> Please try this patch :
> 
> diff --git a/misc/ss.c b/misc/ss.c
> index 5414f75..8c00760 100644
> --- a/misc/ss.c
> +++ b/misc/ss.c
> @@ -1534,8 +1534,10 @@ static int tcp_show_netlink(struct filter *f, FILE *dump_fp, int socktype)
>  		.msg_iovlen = f->f ? 3 : 1,
>  	};
>  
> -	if (sendmsg(fd, &msg, 0) < 0)
> +	if (sendmsg(fd, &msg, 0) < 0) {
> +		close(fd);
>  		return -1;
> +	}
>  
>  	iov[0] = (struct iovec){
>  		.iov_base = buf,
> @@ -1589,6 +1591,10 @@ static int tcp_show_netlink(struct filter *f, FILE *dump_fp, int socktype)
>  					fprintf(stderr, "ERROR truncated\n");
>  				} else {
>  					errno = -err->error;
> +					if (errno == EOPNOTSUPP) {
> +						close(fd);
> +						return -1;
> +					}
>  					perror("TCPDIAG answers");
>  				}
>  				close(fd);

This patch solved the problem. Thank you!

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-04-04 13:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-04  9:03 Commit 8ef874bfc7296fa206eea2ad1e8a426f576bf6f6 has broken ss command Kusanagi Kouichi
2012-04-04  9:07 ` Eric Dumazet
2012-04-04  9:24   ` David Miller
2012-04-04  9:44     ` Eric Dumazet
2012-04-04  9:48       ` Eric Dumazet
2012-04-04 10:00   ` Kusanagi Kouichi
2012-04-04 10:21     ` Eric Dumazet
2012-04-04 13:22       ` Kusanagi Kouichi
2012-04-04  9:25 ` David Miller

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.