Re: git: 0ec13430c583 - main - sys/netinet6: Fix ABI breakage introduced with RFC 7217 support

From: Guido Falsi <madpilot_at_FreeBSD.org>
Date: Mon, 22 Sep 2025 15:44:18 UTC
On 9/22/25 17:37, Jonathan T. Looney wrote:
> On Mon, Sep 22, 2025 at 3:59 AM Guido Falsi <madpilot@freebsd.org 
> <mailto:madpilot@freebsd.org>> wrote:
> 
>     diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
>     index 4f756a75fac7..8ef755e2dc0a 100644
>     --- a/sys/netinet6/in6.c
>     +++ b/sys/netinet6/in6.c
>     @@ -2604,6 +2604,8 @@ in6_domifattach(struct ifnet *ifp)
>              COUNTER_ARRAY_ALLOC(ext->icmp6_ifstat,
>                  sizeof(struct icmp6_ifstat) / sizeof(uint64_t), M_WAITOK);
> 
>     +       ext->dad_failures = counter_u64_alloc(M_WAITOK);
>     +
>              ext->nd_ifinfo = nd6_ifattach(ifp);
>              ext->scope6_id = scope6_ifattach(ifp);
>              ext->lltable = in6_lltattach(ifp);
>     @@ -2639,6 +2641,7 @@ in6_domifdetach(struct ifnet *ifp, void *aux)
>              COUNTER_ARRAY_FREE(ext->icmp6_ifstat,
>                  sizeof(struct icmp6_ifstat) / sizeof(uint64_t));
>              free(ext->icmp6_ifstat, M_IFADDR);
>     +       counter_u64_free(ext->dad_failures);
>              free(ext, M_IFADDR);
>       }
> 
> 
> This seems like it is probably a low-frequency event. If so, why is a 
> counter a better choice for this than an atomic?
> 

I used counters because they were already being used in the netinet6 
code, and are a good match for the use.

-- 
Guido Falsi <madpilot@FreeBSD.org>