• Phil Sutter's avatar
    ss: Fix accidental state filter override · e56a959e
    Phil Sutter authored
    Passing a filter expression and selecting an address family using the
    '-f' flag would overwrite the state filter by accident. Therefore
    calling e.g. 'ss -nl -f inet '(sport = :22)' would not only print
    listening sockets (as requested by '-l' flag) but connected ones, as
    well.
    
    Fix this by reusing the formerly ineffective call to filter_states_set()
    to restore the state filter as it was before the call to
    filter_af_set().
    Signed-off-by: default avatarPhil Sutter <phil@nwl.cc>
    e56a959e
ss.c 88.5 KB