Re: [PATCH v2] net: Protect INET_ADDR_COOKIE on 32-bit architectures

From: Jakub Kicinski
Date: Sat May 09 2020 - 18:39:45 EST


On Sat, 9 May 2020 22:49:28 +0200 Stephen Kitt wrote:
> On Sat, 9 May 2020 21:05:48 +0200, Stephen Kitt <steve@xxxxxxx> wrote:
> > On Sat, 9 May 2020 10:59:14 -0700, Jakub Kicinski <kuba@xxxxxxxxxx> wrote:
> > > What if we went back to your original proposal of an empty struct but
> > > added in an extern in front? That way we should get linker error on
> > > pointer references.
> >
> > That silently fails to fail if any other link object provides a definition
> > for the symbol, even if the type doesnât match...
>
> And it breaks the build if INET_ADDR_COOKIE is used twice in the same unit,
> e.g. in inet_hashtables.c.

Ah, so we'd have to use a valid type like, say, char.