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]
Message-ID: <20201015033648.GA24901@hoboy>
Date:   Wed, 14 Oct 2020 20:36:48 -0700
From:   Richard Cochran <richardcochran@...il.com>
To:     Christian Eggers <ceggers@...i.de>
Cc:     "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Krzysztof Halasa <khalasa@...p.pl>,
        Vishal Kulkarni <vishal@...lsio.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next] net: ptp: get rid of IPV4_HLEN() and OFF_IHL
 macros

On Wed, Oct 14, 2020 at 01:58:05PM +0200, Christian Eggers wrote:
> Both macros are already marked for removal.

I'm not sure what Daniel Borkmann meant by that comment, but ...

>  	switch (type & PTP_CLASS_PMASK) {
>  	case PTP_CLASS_IPV4:
> -		ptr += IPV4_HLEN(ptr) + UDP_HLEN;
> +		ptr += (((struct iphdr *)ptr)->ihl << 2) + UDP_HLEN;

to my eyes

	IPV4_HLEN(ptr)

is way more readable than

	(((struct iphdr *)ptr)->ihl << 2)

and this

	(struct udphdr *)((char *)ih + (ih->ihl << 2))

is really baroque.

I don't see any improvement here.

Thanks,
Richard

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ