From: Eric Dumazet Date: Mon, 20 Jun 2011 21:31:51 +0000 (-0700) Subject: ss: fix autobound filter X-Git-Tag: v2.6.39~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df39de8d2485d24bf5e64201dae191e9ed6ccb0e;p=thirdparty%2Fiproute2.git ss: fix autobound filter 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 --- diff --git a/misc/ss.c b/misc/ss.c index 482b6bb86..4033e9282 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: