References: <20200911115916.16117-1-gert@...1296...> From: Antonio Quartulli Message-ID: Date: Mon, 14 Sep 2020 10:56:59 +0200 MIME-Version: 1.0 In-Reply-To: <20200911115916.16117-1-gert@...1296...> Content-Language: en-US Subject: Re: [Openvpn-devel] [PATCH] If IPv6 pool specification sets pool start to ::0 address, increment. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit To: Gert Doering , openvpn-devel@lists.sourceforge.net Hi, On 11/09/2020 13:59, Gert Doering wrote: > index 1f74ac57..2814ff46 100644 > --- a/src/openvpn/pool.c > +++ b/src/openvpn/pool.c > @@ -224,6 +224,21 @@ ifconfig_pool_init(const bool ipv4_pool, enum pool_type type, in_addr_t start, > } > > pool->ipv6.base = ipv6_base; > + > + /* if a pool starts at ::0, that first IPv6 address is not usable > + * first clients (subnet anycast address). Start with 1, then. > + * NOTE: this will also fire for something like > + * ifconfig-ipv6-pool 2001:db8:0:1:1234::0/64 > + * as we only look at the rightmost 32 bits. So be it... > + */ > + if (base == 0) why not memcmp'ing ipv6.base with in6addr_any (defined in netinet/in.h)? This way you get rid of the first NOTE (unless this header is linux specific..). Regards, -- Antonio Quartulli