]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
netlink: specs: support ipv4-or-v6 for dual-stack fields
authorHangbin Liu <liuhangbin@gmail.com>
Mon, 17 Nov 2025 02:44:56 +0000 (02:44 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 19 Nov 2025 02:42:10 +0000 (18:42 -0800)
Since commit 1b255e1beabf ("tools: ynl: add ipv4-or-v6 display hint"), we
can display either IPv4 or IPv6 addresses for a single field based on the
address family. However, most dual-stack fields still use the ipv4 display
hint. This update changes them to use the new ipv4-or-v6 display hint and
converts IPv4-only fields to use the u32 type.

Field changes:
  - v4-or-v6
    - IFA_ADDRESS, IFA_LOCAL
    - IFLA_GRE_LOCAL, IFLA_GRE_REMOTE
    - IFLA_VTI_LOCAL, IFLA_VTI_REMOTE
    - IFLA_IPTUN_LOCAL, IFLA_IPTUN_REMOTE
    - NDA_DST
    - RTA_DST, RTA_SRC, RTA_GATEWAY, RTA_PREFSRC
    - FRA_SRC, FRA_DST
  - ipv4
    - IFA_BROADCAST
    - IFLA_GENEVE_REMOTE
    - IFLA_IPTUN_6RD_RELAY_PREFIX

Reviewed-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>
Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Link: https://patch.msgid.link/20251117024457.3034-3-liuhangbin@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Documentation/netlink/genetlink-c.yaml
Documentation/netlink/genetlink.yaml
Documentation/netlink/netlink-raw.yaml
Documentation/netlink/specs/rt-addr.yaml
Documentation/netlink/specs/rt-link.yaml
Documentation/netlink/specs/rt-neigh.yaml
Documentation/netlink/specs/rt-route.yaml
Documentation/netlink/specs/rt-rule.yaml

index 5a234e9b5fa2ef47b97c8c5839ba1f40096a58b8..57f59fe23e3f8c66f70e2bdbe9a77168a43dca60 100644 (file)
@@ -227,7 +227,7 @@ properties:
                   Optional format indicator that is intended only for choosing
                   the right formatting mechanism when displaying values of this
                   type.
-                enum: [ hex, mac, fddi, ipv4, ipv6, uuid ]
+                enum: [ hex, mac, fddi, ipv4, ipv6, ipv4-or-v6, uuid ]
               # Start genetlink-c
               name-prefix:
                 type: string
index 7b1ec153e83490f03949251e37f3cc289f48fa14..b020a537d8acdbcaee0e9b62aa4cef009ea9bb59 100644 (file)
@@ -185,7 +185,7 @@ properties:
                   Optional format indicator that is intended only for choosing
                   the right formatting mechanism when displaying values of this
                   type.
-                enum: [ hex, mac, fddi, ipv4, ipv6, uuid ]
+                enum: [ hex, mac, fddi, ipv4, ipv6, ipv4-or-v6, uuid ]
 
       # Make sure name-prefix does not appear in subsets (subsets inherit naming)
       dependencies:
index 246fa07bccf6879bde1c97f7ab03e8abaf5fc626..0166a7e4afbbf7c2d5217972dff192b6ca521618 100644 (file)
@@ -157,7 +157,7 @@ properties:
                   Optional format indicator that is intended only for choosing
                   the right formatting mechanism when displaying values of this
                   type.
-                enum: [ hex, mac, fddi, ipv4, ipv6, uuid ]
+                enum: [ hex, mac, fddi, ipv4, ipv6, ipv4-or-v6, uuid ]
               struct:
                 description: Name of the nested struct type.
                 type: string
index 3a582eac1629ee50bd6257dcdfc54ca27a03c03a..abcbaa73fa9dc37c0a2dbb2c288f59fa96ebc4fb 100644 (file)
@@ -86,17 +86,17 @@ attribute-sets:
       -
         name: address
         type: binary
-        display-hint: ipv4
+        display-hint: ipv4-or-v6
       -
         name: local
         type: binary
-        display-hint: ipv4
+        display-hint: ipv4-or-v6
       -
         name: label
         type: string
       -
         name: broadcast
-        type: binary
+        type: u32
         display-hint: ipv4
       -
         name: anycast
index e073415827718c7fb2ff619de1928f3c3627145b..ca22c68ca6914ab50a2648091a9f1cd4c129ab7e 100644 (file)
@@ -1707,11 +1707,11 @@ attribute-sets:
       -
         name: local
         type: binary
-        display-hint: ipv4
+        display-hint: ipv4-or-v6
       -
         name: remote
         type: binary
-        display-hint: ipv4
+        display-hint: ipv4-or-v6
       -
         name: ttl
         type: u8
@@ -1833,11 +1833,11 @@ attribute-sets:
       -
         name: local
         type: binary
-        display-hint: ipv4
+        display-hint: ipv4-or-v6
       -
         name: remote
         type: binary
-        display-hint: ipv4
+        display-hint: ipv4-or-v6
       -
         name: fwmark
         type: u32
@@ -1868,7 +1868,7 @@ attribute-sets:
         type: u32
       -
         name: remote
-        type: binary
+        type: u32
         display-hint: ipv4
       -
         name: ttl
@@ -1952,11 +1952,11 @@ attribute-sets:
       -
         name: local
         type: binary
-        display-hint: ipv4
+        display-hint: ipv4-or-v6
       -
         name: remote
         type: binary
-        display-hint: ipv4
+        display-hint: ipv4-or-v6
       -
         name: ttl
         type: u8
@@ -1986,7 +1986,7 @@ attribute-sets:
         display-hint: ipv6
       -
         name: 6rd-relay-prefix
-        type: binary
+        type: u32
         display-hint: ipv4
       -
         name: 6rd-prefixlen
index 2f568a6231c9309aa8aec00907ea10a4e3359c1a..0f46ef3135905d31b441dd84a3e08c7acb0f5d47 100644 (file)
@@ -194,7 +194,7 @@ attribute-sets:
       -
         name: dst
         type: binary
-        display-hint: ipv4
+        display-hint: ipv4-or-v6
       -
         name: lladdr
         type: binary
index 1ecb3fadc0679fb577d73717ddda4e9c5d61d624..33195db96746c6f83a8e76d082cae35ecd0eefcb 100644 (file)
@@ -87,11 +87,11 @@ attribute-sets:
       -
         name: dst
         type: binary
-        display-hint: ipv4
+        display-hint: ipv4-or-v6
       -
         name: src
         type: binary
-        display-hint: ipv4
+        display-hint: ipv4-or-v6
       -
         name: iif
         type: u32
@@ -101,14 +101,14 @@ attribute-sets:
       -
         name: gateway
         type: binary
-        display-hint: ipv4
+        display-hint: ipv4-or-v6
       -
         name: priority
         type: u32
       -
         name: prefsrc
         type: binary
-        display-hint: ipv4
+        display-hint: ipv4-or-v6
       -
         name: metrics
         type: nest
index bebee452a95073332e7b0681ddd97560ce873f20..7f03a44ab0361ec29366094de09b88f3819fb423 100644 (file)
@@ -96,10 +96,12 @@ attribute-sets:
     attributes:
       -
         name: dst
-        type: u32
+        type: binary
+        display-hint: ipv4-or-v6
       -
         name: src
-        type: u32
+        type: binary
+        display-hint: ipv4-or-v6
       -
         name: iifname
         type: string