public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail•com>
To: Thayne McCombs <astrothayne@gmail•com>, netdev@vger•kernel.org
Subject: Re: [PATCH iproute2-next] ss: always prefer family as part of host condition to default family
Date: Mon, 1 Feb 2021 20:04:10 -0700	[thread overview]
Message-ID: <6d0eff35-b982-7d8d-d3c7-742411e93046@gmail.com> (raw)
In-Reply-To: <20210131081728.29476-1-astrothayne@gmail.com>

On 1/31/21 1:17 AM, Thayne McCombs wrote:
> diff --git a/misc/ss.c b/misc/ss.c
> index 0593627b..2a5e056a 100644
> --- a/misc/ss.c
> +++ b/misc/ss.c
> @@ -2119,24 +2119,39 @@ void *parse_hostcond(char *addr, bool is_port)
>  	int fam = preferred_family;
>  	struct filter *f = &current_filter;
>  
> -	if (fam == AF_UNIX || strncmp(addr, "unix:", 5) == 0) {
> +    if (strncmp(addr, "unix:", 5) == 0) {
> +        fam = AF_UNIX;
> +        addr += 5;
> +    } else if (strncmp(addr, "link:", 5) == 0) {
> +        fam = AF_PACKET;
> +        addr += 5;
> +    } else if (strncmp(addr, "netlink:", 8) == 0) {
> +        fam = AF_NETLINK;
> +        addr += 8;
> +    } else if (strncmp(addr, "vsock:", 6) == 0) {
> +        fam = AF_VSOCK;
> +        addr += 6;
> +    } else if (strncmp(addr, "inet:", 5) == 0) {
> +        fam = AF_INET;
> +        addr += 5;
> +    } else if (strncmp(addr, "inet6:", 6) == 0) {
> +        fam = AF_INET6;
> +        addr += 6;
> +    }
> +
> +	if (fam == AF_UNIX) {
>  		char *p;
>  

Looks fine to me, but you need to fix the coding style -- tabs, not spaces.


  reply	other threads:[~2021-02-02  3:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-31  8:17 [PATCH iproute2-next] ss: always prefer family as part of host condition to default family Thayne McCombs
2021-02-02  3:04 ` David Ahern [this message]
2021-02-02  3:32   ` [PATCH ip-route2-next v2] " Thayne McCombs
2021-02-05  4:57     ` David Ahern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6d0eff35-b982-7d8d-d3c7-742411e93046@gmail.com \
    --to=dsahern@gmail$(echo .)com \
    --cc=astrothayne@gmail$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox