Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Oct 2020 07:50:33 -0500 (CDT)
From:      Lewis Donzis <lew@perftech.com>
To:        freebsd-net@freebsd.org
Subject:   IPv6 const addresses
Message-ID:  <575523911.10588327.1602593433541.JavaMail.zimbra@donzis.com>
In-Reply-To: <4DB3A1EB-CC4B-440E-9370-7597EFAAEB38@FreeBSD.org>
References:  <7166d87e-7547-6be8-42a7-b0957ca4f543@norma.perm.ru> <5FB9EFF9-0D95-4FC6-9469-2FC29D479379@FreeBSD.org> <7cf8b21a-b100-c6d6-fc98-4636386ed8b8@norma.perm.ru> <4DB3A1EB-CC4B-440E-9370-7597EFAAEB38@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hello.

It appears that there are some missing definitions for a couple of the "const struct in6_addr" values that are included in in6.h.

Here are the relevant declarations in /usr/include/netinet6/in6.h:

extern const struct in6_addr in6addr_any;
extern const struct in6_addr in6addr_loopback;
extern const struct in6_addr in6addr_nodelocal_allnodes;
extern const struct in6_addr in6addr_linklocal_allnodes;
extern const struct in6_addr in6addr_linklocal_allrouters;
extern const struct in6_addr in6addr_linklocal_allv2routers;

However, here are the definitions in /usr/src/lib/libc/net/vars.c:

const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT;
const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT;
const struct in6_addr in6addr_nodelocal_allnodes = IN6ADDR_NODELOCAL_ALLNODES_INIT;
const struct in6_addr in6addr_linklocal_allnodes = IN6ADDR_LINKLOCAL_ALLNODES_INIT;

As you can see, in6addr_linklocal_allrouters and in6addr_linklocal_allv2routers are missing.  Attempting to use the missing definitions results in a linker error because they are declared properly.

The static initializer values are defined in /usr/include/netinet6/in6.h:

#define IN6ADDR_ANY_INIT \
#define IN6ADDR_LOOPBACK_INIT \
#define IN6ADDR_NODELOCAL_ALLNODES_INIT \
#define IN6ADDR_INTFACELOCAL_ALLNODES_INIT \
#define IN6ADDR_LINKLOCAL_ALLNODES_INIT \
#define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \
#define IN6ADDR_LINKLOCAL_ALLV2ROUTERS_INIT \

So it seems a simple matter of adding the two missing ones to /usr/src/lib/libc/net/vars.c.

Thanks,
lew



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?575523911.10588327.1602593433541.JavaMail.zimbra>