diff mbox

[iproute2] ss: fix autobound filter

Message ID 1308316911.2780.6.camel@edumazet-laptop
State Accepted, archived
Delegated to: stephen hemminger
Headers show

Commit Message

Eric Dumazet June 17, 2011, 1:21 p.m. UTC
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(-)



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

stephen hemminger June 21, 2011, 3:54 p.m. UTC | #1
On Fri, 17 Jun 2011 15:21:51 +0200
Eric Dumazet <eric.dumazet@gmail.com> wrote:

> 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>

Applied thanks

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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: