Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <571b913c-db43-5c5d-a6fa-b4e18c298ad2@mirbsd.de>
Date: Sat, 26 Jul 2025 02:53:19 +0200 (CEST)
From: Thorsten Glaser <tg@...bsd.de>
To: musl@...ts.openwall.com
Subject: Re: Bug in IN6_IS_ADDR_V4COMPAT macro for addresses ending
 in .1

On Fri, 25 Jul 2025, Rich Felker wrote:

>>  +         ((uint32_t *) (a))[2] == 0 && ((uint32_t *) (a))[3] > 1)
>>
>> Untested, and I’ve not yet had enough coffee, so DWIM ☻
>
>This is not valid, You can't do order comparisons on the uint32_t
>units because they're byte order dependent.

Oh, right.

>But I suspect the actual intent is not >1 but !=0.

No, it is exactly “NOT IN (0, 1)”.

Basically, :: (IPv6 any) and ::1 (IPv6 localhost) need to be excluded
from the sets of IPv6 addresses that begin with all-zero before an
embedded IPv4 address (except 0.0.0.0 and 0.0.0.1), and optionally
a :FFFF: before *that*, depending on use case (apparently not here).

+         ((uint32_t *) (a))[2] == 0 && ntohl((uint32_t *) (a))[3] > 1)

Maybe this?

bye,
//mirabilos
-- 
„Cool, /usr/share/doc/mksh/examples/uhr.gz ist ja ein Grund,
mksh auf jedem System zu installieren.“
	-- XTaran auf der OpenRheinRuhr, ganz begeistert
(EN: “[…]uhr.gz is a reason to install mksh on every system.”)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.