]> git.proxmox.com Git - mirror_iproute2.git/commit - misc/ss.c
iproute2: misc/ss.c - fix run_ssfilter af_packet when protocol == 0
authorMaciej Żenczykowski <maze@google.com>
Thu, 25 Jun 2015 09:03:03 +0000 (02:03 -0700)
committerStephen Hemminger <shemming@brocade.com>
Thu, 25 Jun 2015 12:52:06 +0000 (08:52 -0400)
commitbbd303d183a5638be7feb952b6266a9251bce348
tree4b489e88e482388a932506fb62303dc0d71aaa90
parent0bbca0422f9779cc4eeaf70aa01dcad10d6ab076
iproute2: misc/ss.c - fix run_ssfilter af_packet when protocol == 0

s->local.data is a pointer to a field of a non-NULL struct, and hence
cannot be NULL, thus comparing it to 0 is always false, and thus the
return is always false.

Presumably this was meant to be a check whether s->local.data[0] (which
I believe stores af_packet protocol) is 0, ie. ANY.

Change-Id: Ia232f5b06ce081e3b2fb6338f1a709cd94e03ae5
Fixes:
  ss.c:1018:37: error: comparison of array 's->local.data' equal to a null pointer is always false [-Werror,-Wtautological-pointer-compare]
    return s->lport == 0 && s->local.data == 0;
                            ~~~~~~~~~^~~~    ~
  1 error generated.
misc/ss.c