Netdev List
 help / color / mirror / Atom feed
* [PATCH iproute2] ss: fix autobound filter
@ 2011-06-17 13:21 Eric Dumazet
  2011-06-21 15:54 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2011-06-17 13:21 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

Fixes following error. We currently provide garbage data to kernel, that
can abort the validation process or produce unexpected results.

$ ss -a autobound
State      Recv-Q Send-Q      Local Address:Port          Peer Address:Port   
TCPDIAG answers: Invalid argument

After patch:

$ misc/ss -a autobound 
State      Recv-Q Send-Q      Local Address:Port          Peer Address:Port   
LISTEN     0      128                     *:44624                    *:*       
ESTAB      0      0            192.168.1.21:47141        74.125.79.109:imaps   

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
 misc/ss.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/misc/ss.c b/misc/ss.c
index 482b6bb..4033e92 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -803,7 +803,7 @@ static int ssfilter_bytecompile(struct ssfilter *f, char **bytecode)
 	{
 		if (!(*bytecode=malloc(4))) abort();
 		((struct inet_diag_bc_op*)*bytecode)[0] = (struct inet_diag_bc_op){ INET_DIAG_BC_AUTO, 4, 8 };
-		return 8;
+		return 4;
 	}
 		case SSF_DCOND:
 		case SSF_SCOND:



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

end of thread, other threads:[~2011-06-21 15:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-17 13:21 [PATCH iproute2] ss: fix autobound filter Eric Dumazet
2011-06-21 15:54 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox