netlink: specs: rt-route: add the route deletion reason

Add the del-reason attribute and its enum to the route attribute set,
and to the getroute reply, which the route notifications reuse.

The attribute is absent from the newroute and delroute request lists.
RTA_DEL_REASON is above strict_start_type in rtm_ipv6_policy, so
encoding it in a request is rejected with -EINVAL.

Signed-off-by: Yuyang Huang <sigefriedhyy@gmail.com>
Link: https://patch.msgid.link/20260808005642.26901-10-sigefriedhyy@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
Yuyang Huang
2026-08-08 09:56:41 +09:00
committed by Paolo Abeni
parent 8621a7ed80
commit b13ba4e82b

View File

@@ -78,6 +78,27 @@ definitions:
-
name: rta-used
type: u32
-
name: del-reason
type: enum
name-prefix: rt-del-reason-
enum-name: rt-del-reason
doc: |
Why the kernel deleted a route. New causes may be appended. The
value space is family-agnostic, a value is never reinterpreted
per address family.
entries:
-
name: unspec
doc: The deletion path does not record a cause.
-
name: expired
doc: The RTF_EXPIRES lifetime ran out and the route was garbage
collected.
-
name: ra-withdrawn
doc: A Router Advertisement withdrew the route with a zero
lifetime.
attribute-sets:
-
@@ -185,6 +206,18 @@ attribute-sets:
type: u32
byte-order: big-endian
display-hint: hex
-
name: del-reason
type: u32
enum: del-reason
doc: |
Emitted only on RTM_DELROUTE notifications, and only when the
deletion path records a cause. An absent attribute means
either an older kernel or a deletion path that does not
record its cause, consumers must treat absent and unspec
identically. Currently only IPv6 deletion paths record a
cause. The attribute is notification-only, the kernel rejects
it in requests.
-
name: metrics
name-prefix: rtax-
@@ -299,6 +332,7 @@ operations:
- dport
- nh-id
- flowlabel
- del-reason
dump:
request:
value: 26