Index | Thread | Search

From:
Alexander Bluhm <bluhm@openbsd.org>
Subject:
Re: RFC 6724 rule 5.5
To:
tech <tech@openbsd.org>
Date:
Tue, 16 Apr 2024 19:22:22 +0200

Download raw body.

Thread
On Tue, Apr 16, 2024 at 06:23:07PM +0200, Florian Obser wrote:
> On 2024-04-16 14:28 +02, Florian Obser <florian@openbsd.org> wrote:
> > Disregard please, I'll get rid of the nonsensical IFF_LOOPBACK case
> > first I think that will make this slightly easier / compacter.
> 
> OK?

The following chunk is wrong and not necessary.  It you remove that
part from the diff, it is OK bluhm@

> @@ -660,6 +653,11 @@ in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra,
>  		} else {
>  			ia6->ia_ifa.ifa_dstaddr = NULL;
>  		}
> +		if ((ifra->ifra_flags & IN6_IFF_AUTOCONF) == 0)

The logic is inverted, this should be
ISSET(ifra->ifra_flags, IN6_IFF_AUTOCONF).  The == 0 is hard to follow.

> +			ia6->ia_gwaddr = dst6;

This whole block is not necessery as you will set ia_gwaddr later.

> +		else
> +			memset(&ia6->ia_gwaddr, 0, sizeof(ia6->ia_gwaddr));

The memset is not necessery as malloc() above has M_ZERO.

> +
>  		ia6->ia_ifa.ifa_netmask = sin6tosa(&ia6->ia_prefixmask);
>  
>  		ia6->ia_ifp = ifp;