]> git.proxmox.com Git - mirror_iproute2.git/commit
ss: allow AF_FAMILY constants >32
authorStefan Hajnoczi <stefanha@redhat.com>
Fri, 6 Oct 2017 15:48:39 +0000 (11:48 -0400)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 11 Oct 2017 17:50:20 +0000 (10:50 -0700)
commitb338a3e7e7d95c9d46de9748604da06287664033
tree3aa14ed707beacf4c4a4d2a6dabe0f8f9c550877
parente9b0d82dfac25912cf757945d9caf6fe2371f526
ss: allow AF_FAMILY constants >32

Linux has more than 32 address families defined in <bits/socket.h>.  Use
a 64-bit type so all of them can be represented in the filter->families
bitmask.

It's easy to introduce bugs when using (1 << AF_FAMILY) because the
value is 32-bit.  This can produce incorrect results from bitmask
operations so introduce the FAMILY_MASK() macro to eliminate these bugs.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
misc/ss.c