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:   Thu, 27 Jul 2017 11:11:20 +0200
From:   Phil Sutter <phil@....cc>
To:     Hangbin Liu <liuhangbin@...il.com>
Cc:     netdev@...r.kernel.org,
        Nikolay Aleksandrov <nikolay@...ulusnetworks.com>,
        Stephen Hemminger <stephen@...workplumber.org>
Subject: Re: [PATCH iproute2] utils: also check AF_INET family when rtm_type
 is RTN_MULTICAST

Hi Hangbin,

On Thu, Jul 27, 2017 at 05:01:49PM +0800, Hangbin Liu wrote:
[...]
> diff --git a/lib/utils.c b/lib/utils.c
> index e77bd30..0479e00 100644
> --- a/lib/utils.c
> +++ b/lib/utils.c
> @@ -1215,5 +1215,6 @@ int get_real_family(int rtm_type, int rtm_family)
>  	if (rtm_type != RTN_MULTICAST)
>  		return rtm_family;
>  
> -	return rtm_family == RTNL_FAMILY_IPMR ? AF_INET : AF_INET6;
> +	return (rtm_family == RTNL_FAMILY_IPMR ||
> +		rtm_family == AF_INET) ? AF_INET : AF_INET6;
>  }

I think this is not very readable. How about this instead:

-       return rtm_family == RTNL_FAMILY_IPMR ? AF_INET : AF_INET6;
+       if (rtm_family == RTNL_FAMILY_IPMR)
+               return AF_INET;
+
+       return rtm_family;

Thanks, Phil

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ