Skip to content

Commit 0c8e302

Browse files
committed
netlink: specs: rt_addr: pull the ifa- prefix out of the names
YAML specs don't normally include the C prefix name in the name of the YAML attr. Remove the ifa- prefix from all attributes in addr-attrs and specify name-prefix instead. This is a bit risky, hopefully there aren't many users out there. Fixes: dfb0f7d ("doc/netlink: Add spec for rt addr messages") Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20250403013706.2828322-4-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 524c035 commit 0c8e302

File tree

2 files changed

+21
-20
lines changed

2 files changed

+21
-20
lines changed

Documentation/netlink/specs/rt_addr.yaml

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -78,45 +78,46 @@ definitions:
7878
attribute-sets:
7979
-
8080
name: addr-attrs
81+
name-prefix: ifa-
8182
attributes:
8283
-
83-
name: ifa-address
84+
name: address
8485
type: binary
8586
display-hint: ipv4
8687
-
87-
name: ifa-local
88+
name: local
8889
type: binary
8990
display-hint: ipv4
9091
-
91-
name: ifa-label
92+
name: label
9293
type: string
9394
-
94-
name: ifa-broadcast
95+
name: broadcast
9596
type: binary
9697
display-hint: ipv4
9798
-
98-
name: ifa-anycast
99+
name: anycast
99100
type: binary
100101
-
101-
name: ifa-cacheinfo
102+
name: cacheinfo
102103
type: binary
103104
struct: ifa-cacheinfo
104105
-
105-
name: ifa-multicast
106+
name: multicast
106107
type: binary
107108
-
108-
name: ifa-flags
109+
name: flags
109110
type: u32
110111
enum: ifa-flags
111112
enum-as-flags: true
112113
-
113-
name: ifa-rt-priority
114+
name: rt-priority
114115
type: u32
115116
-
116-
name: ifa-target-netnsid
117+
name: target-netnsid
117118
type: binary
118119
-
119-
name: ifa-proto
120+
name: proto
120121
type: u8
121122

122123

@@ -137,10 +138,10 @@ operations:
137138
- ifa-prefixlen
138139
- ifa-scope
139140
- ifa-index
140-
- ifa-address
141-
- ifa-label
142-
- ifa-local
143-
- ifa-cacheinfo
141+
- address
142+
- label
143+
- local
144+
- cacheinfo
144145
-
145146
name: deladdr
146147
doc: Remove address
@@ -154,8 +155,8 @@ operations:
154155
- ifa-prefixlen
155156
- ifa-scope
156157
- ifa-index
157-
- ifa-address
158-
- ifa-local
158+
- address
159+
- local
159160
-
160161
name: getaddr
161162
doc: Dump address information.
@@ -182,8 +183,8 @@ operations:
182183
reply:
183184
value: 58
184185
attributes: &mcaddr-attrs
185-
- ifa-multicast
186-
- ifa-cacheinfo
186+
- multicast
187+
- cacheinfo
187188
dump:
188189
request:
189190
value: 58

tools/testing/selftests/net/rtnetlink.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def dump_mcaddr_check(rtnl: RtnlAddrFamily) -> None:
1515
addresses = rtnl.getmulticast({"ifa-family": socket.AF_INET}, dump=True)
1616

1717
all_host_multicasts = [
18-
addr for addr in addresses if addr['ifa-multicast'] == IPV4_ALL_HOSTS_MULTICAST
18+
addr for addr in addresses if addr['multicast'] == IPV4_ALL_HOSTS_MULTICAST
1919
]
2020

2121
ksft_ge(len(all_host_multicasts), 1,

0 commit comments

Comments
 (0)