lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 1 Feb 2021 20:04:10 -0700
From:   David Ahern <dsahern@...il.com>
To:     Thayne McCombs <astrothayne@...il.com>, netdev@...r.kernel.org
Subject: Re: [PATCH iproute2-next] ss: always prefer family as part of host
 condition to default family

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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ