Netdev List
 help / color / mirror / Atom feed
* [PATCH net] netlink: specs: rt-link: fix ipv6 devconf doc
@ 2026-08-24 10:38 Asbjørn Sloth Tønnesen
  2026-08-24 10:42 ` Fernando Fernandez Mancera
  2026-08-27 10:55 ` Paolo Abeni
  0 siblings, 2 replies; 4+ messages in thread
From: Asbjørn Sloth Tønnesen @ 2026-08-24 10:38 UTC (permalink / raw)
  To: Donald Hunter, Jakub Kicinski
  Cc: Asbjørn Sloth Tønnesen, David S . Miller, Eric Dumazet,
	Paolo Abeni, Simon Horman, Felix Maurer, Danielle Ratson,
	Fernando Fernandez Mancera, netdev, linux-kernel, stable

devconf is even odder than described in the blamed commit, where bpth
IPv4 and IPv6 are described in an identical way:
"u32 indexed by ipv?-devconf - 1 on output, on input it's a nest".

There are two issues with that line for IPv6:

1) The subtraction is an IPv4 specific quirk, to avoid having an unused
   u32 at index 0, thus saving 4 bytes per net device being dumped:

   - In include/uapi/linux/ip.h the IPV4_DEVCONF_* enum begins with
     IPV4_DEVCONF_FORWARDING = 1, so the enum starts at 1, which is
     the reason for the subtraction in the IPv4 variant.

   - In include/uapi/linux/ipv6.h the DEVCONF_* enum begins with
     DEVCONF_FORWARDING = 0, so subtraction would underflow.

   - ipv6_store_devconf() in net/ipv6/addrconf.c also doesn't do the
     subtraction in the output path.

2) Setting IPv6 devconf through Netlink is not yet supported, as
   IFLA_INET6_CONF is not handled in inet6_set_link_af().

Fixes: 720447bd0b24 ("netlink: specs: rt-link: remove implicit structs from devconf")
Cc: stable@vger.kernel.org
Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>
---

Fernando, please remember to reintroduce the ", on input it's a nest"
in your WIP/planned patchset that introduces support for setting IPv6
devconf via IFLA_INET6_CONF.
https://lore.kernel.org/bd560c89-c71f-4ef5-a0fd-5ea096a0f767@suse.de/

 Documentation/netlink/specs/rt-link.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/netlink/specs/rt-link.yaml b/Documentation/netlink/specs/rt-link.yaml
index b80c2ac3ac31..00c915031efd 100644
--- a/Documentation/netlink/specs/rt-link.yaml
+++ b/Documentation/netlink/specs/rt-link.yaml
@@ -2218,7 +2218,7 @@ attribute-sets:
         name: conf
         type: binary
         sub-type: u32
-        doc: u32 indexed by ipv6-devconf - 1 on output, on input it's a nest
+        doc: u32 indexed by ipv6-devconf on output, input is not yet implemented
       -
         name: stats
         type: binary

base-commit: 7cbfb180945ce529608e4d4e24a6d483699fab1e
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net] netlink: specs: rt-link: fix ipv6 devconf doc
  2026-08-24 10:38 [PATCH net] netlink: specs: rt-link: fix ipv6 devconf doc Asbjørn Sloth Tønnesen
@ 2026-08-24 10:42 ` Fernando Fernandez Mancera
  2026-08-27 10:55 ` Paolo Abeni
  1 sibling, 0 replies; 4+ messages in thread
From: Fernando Fernandez Mancera @ 2026-08-24 10:42 UTC (permalink / raw)
  To: Asbjørn Sloth Tønnesen, Donald Hunter, Jakub Kicinski
  Cc: David S . Miller, Eric Dumazet, Paolo Abeni, Simon Horman,
	Felix Maurer, Danielle Ratson, netdev, linux-kernel, stable

On 8/24/26 12:38 PM, Asbjørn Sloth Tønnesen wrote:
> devconf is even odder than described in the blamed commit, where bpth
> IPv4 and IPv6 are described in an identical way:
> "u32 indexed by ipv?-devconf - 1 on output, on input it's a nest".
> 
> There are two issues with that line for IPv6:
> 
> 1) The subtraction is an IPv4 specific quirk, to avoid having an unused
>     u32 at index 0, thus saving 4 bytes per net device being dumped:
> 
>     - In include/uapi/linux/ip.h the IPV4_DEVCONF_* enum begins with
>       IPV4_DEVCONF_FORWARDING = 1, so the enum starts at 1, which is
>       the reason for the subtraction in the IPv4 variant.
> 
>     - In include/uapi/linux/ipv6.h the DEVCONF_* enum begins with
>       DEVCONF_FORWARDING = 0, so subtraction would underflow.
> 
>     - ipv6_store_devconf() in net/ipv6/addrconf.c also doesn't do the
>       subtraction in the output path.
> 
> 2) Setting IPv6 devconf through Netlink is not yet supported, as
>     IFLA_INET6_CONF is not handled in inet6_set_link_af().
> 
> Fixes: 720447bd0b24 ("netlink: specs: rt-link: remove implicit structs from devconf")

Does this really require a fixes tag + stable Cc'ed? In any case, LGTM.

> Cc: stable@vger.kernel.org
> Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>
> ---
> 
> Fernando, please remember to reintroduce the ", on input it's a nest"
> in your WIP/planned patchset that introduces support for setting IPv6
> devconf via IFLA_INET6_CONF.
> https://lore.kernel.org/bd560c89-c71f-4ef5-a0fd-5ea096a0f767@suse.de/

Thanks!

I will make sure to reintroduce it, once the netdev is open again I will 
send a patch implementing it.

Reviewed-by: Fernando Fernandez Mancera <fmancera@suse.de>

> 
>   Documentation/netlink/specs/rt-link.yaml | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Documentation/netlink/specs/rt-link.yaml b/Documentation/netlink/specs/rt-link.yaml
> index b80c2ac3ac31..00c915031efd 100644
> --- a/Documentation/netlink/specs/rt-link.yaml
> +++ b/Documentation/netlink/specs/rt-link.yaml
> @@ -2218,7 +2218,7 @@ attribute-sets:
>           name: conf
>           type: binary
>           sub-type: u32
> -        doc: u32 indexed by ipv6-devconf - 1 on output, on input it's a nest
> +        doc: u32 indexed by ipv6-devconf on output, input is not yet implemented
>         -
>           name: stats
>           type: binary
> 
> base-commit: 7cbfb180945ce529608e4d4e24a6d483699fab1e


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] netlink: specs: rt-link: fix ipv6 devconf doc
  2026-08-24 10:38 [PATCH net] netlink: specs: rt-link: fix ipv6 devconf doc Asbjørn Sloth Tønnesen
  2026-08-24 10:42 ` Fernando Fernandez Mancera
@ 2026-08-27 10:55 ` Paolo Abeni
  2026-08-27 11:39   ` Asbjørn Sloth Tønnesen
  1 sibling, 1 reply; 4+ messages in thread
From: Paolo Abeni @ 2026-08-27 10:55 UTC (permalink / raw)
  To: Asbjørn Sloth Tønnesen, Donald Hunter, Jakub Kicinski
  Cc: David S . Miller, Eric Dumazet, Simon Horman, Felix Maurer,
	Danielle Ratson, Fernando Fernandez Mancera, netdev, linux-kernel,
	stable

On 8/24/26 12:38 PM, Asbjørn Sloth Tønnesen wrote:
> devconf is even odder than described in the blamed commit, where bpth
> IPv4 and IPv6 are described in an identical way:
> "u32 indexed by ipv?-devconf - 1 on output, on input it's a nest".
> 
> There are two issues with that line for IPv6:
> 
> 1) The subtraction is an IPv4 specific quirk, to avoid having an unused
>    u32 at index 0, thus saving 4 bytes per net device being dumped:
> 
>    - In include/uapi/linux/ip.h the IPV4_DEVCONF_* enum begins with
>      IPV4_DEVCONF_FORWARDING = 1, so the enum starts at 1, which is
>      the reason for the subtraction in the IPv4 variant.
> 
>    - In include/uapi/linux/ipv6.h the DEVCONF_* enum begins with
>      DEVCONF_FORWARDING = 0, so subtraction would underflow.
> 
>    - ipv6_store_devconf() in net/ipv6/addrconf.c also doesn't do the
>      subtraction in the output path.
> 
> 2) Setting IPv6 devconf through Netlink is not yet supported, as
>    IFLA_INET6_CONF is not handled in inet6_set_link_af().
> 
> Fixes: 720447bd0b24 ("netlink: specs: rt-link: remove implicit structs from devconf")
> Cc: stable@vger.kernel.org
> Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>
Nowadays net PRs are already too big due more-or-less security-relevant
changes. I think this is better suited for net-next, with no 'fixes' tag
nor stable cc, WDYT?

/P


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] netlink: specs: rt-link: fix ipv6 devconf doc
  2026-08-27 10:55 ` Paolo Abeni
@ 2026-08-27 11:39   ` Asbjørn Sloth Tønnesen
  0 siblings, 0 replies; 4+ messages in thread
From: Asbjørn Sloth Tønnesen @ 2026-08-27 11:39 UTC (permalink / raw)
  To: Paolo Abeni, Donald Hunter, Jakub Kicinski
  Cc: David S . Miller, Eric Dumazet, Simon Horman, Felix Maurer,
	Danielle Ratson, Fernando Fernandez Mancera, netdev, linux-kernel,
	stable

On 8/27/26 10:55 AM, Paolo Abeni wrote:
> On 8/24/26 12:38 PM, Asbjørn Sloth Tønnesen wrote:
>> devconf is even odder than described in the blamed commit, where bpth
>> IPv4 and IPv6 are described in an identical way:
>> "u32 indexed by ipv?-devconf - 1 on output, on input it's a nest".
>>
>> There are two issues with that line for IPv6:
>>
>> 1) The subtraction is an IPv4 specific quirk, to avoid having an unused
>>     u32 at index 0, thus saving 4 bytes per net device being dumped:
>>
>>     - In include/uapi/linux/ip.h the IPV4_DEVCONF_* enum begins with
>>       IPV4_DEVCONF_FORWARDING = 1, so the enum starts at 1, which is
>>       the reason for the subtraction in the IPv4 variant.
>>
>>     - In include/uapi/linux/ipv6.h the DEVCONF_* enum begins with
>>       DEVCONF_FORWARDING = 0, so subtraction would underflow.
>>
>>     - ipv6_store_devconf() in net/ipv6/addrconf.c also doesn't do the
>>       subtraction in the output path.
>>
>> 2) Setting IPv6 devconf through Netlink is not yet supported, as
>>     IFLA_INET6_CONF is not handled in inet6_set_link_af().
>>
>> Fixes: 720447bd0b24 ("netlink: specs: rt-link: remove implicit structs from devconf")
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>
> Nowadays net PRs are already too big due more-or-less security-relevant
> changes. I think this is better suited for net-next, with no 'fixes' tag
> nor stable cc, WDYT?

The unsupported input is the main doc correction, that I would like to go into
v7.3 and earlier, as Fernando is planning to add that support for v7.4.

I stumbled upon this, as I was trying to getting rid of some sysctl calls
in an internal provisioning tool.

If the PR size is already an issue for rc1, then I can resubmit when net-next opens.
(I assumed that you were trying to make the net PR sizes into an reversed xmas tree)

It's likely going to end up in stable regardless, it's just easier for Greg and
Sasha when it's tagged.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-08-27 11:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-24 10:38 [PATCH net] netlink: specs: rt-link: fix ipv6 devconf doc Asbjørn Sloth Tønnesen
2026-08-24 10:42 ` Fernando Fernandez Mancera
2026-08-27 10:55 ` Paolo Abeni
2026-08-27 11:39   ` Asbjørn Sloth Tønnesen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox