Skip to content

ss has incorrect option parsing #76

Description

@rrotter

ss (in iproute2) uses getopt_long, which is totally different from the procedural parsing that ip and bridge do. Because ss (in this project) has parsing mostly duplicated from ip, there are several errors in cli parsing:

  • ss -x isn't accepted
  • ss -unix should be parsed as ss -u -n -i -x, but it's currently parsed as ss --unix
  • grouped opts like ss -xH don't work
  • etc…

I'll submit a patch for this within a week or two if someone else doesn't beat me to it. I'm reporting this as both an FYI, and an explanation as to why I didn't include any changes to ss in #74.

Activity

  1. glensc commented on Mar 27, 2026

    @glensc

    I'm used to ss -nat (muscle memory), and it doesn't work:

    $ ss -nat
    Option "-nat" is unknown, try "ss -help".
    $ ss -n -a -t | head -n1
    Netid	State	Recv-Q	Send-Q	Local Address:Port	Peer Address:Port
    
  2. brona commented on Mar 29, 2026

    @brona
    Owner

    I tried to addresses these in 1.7.3.

    FYI from man ss

     -x, --unix
                         Display Unix domain sockets (alias for -f unix).
    

    So unix shouldn't be treated as ss -u -n -i -x

    Re -H, that is currently not implemented (--no-header), but this should be pretty straightforward.

  3. added a commit that references this issue on Mar 29, 2026
  4. added a commit that references this issue on Mar 30, 2026
    e856c20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions