aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/userspace-api/netlink/intro.rst
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2022-08-25 20:09:31 -0700
committerPaolo Abeni <pabeni@redhat.com>2022-08-30 12:20:43 +0200
commit690252f19f0e486abb8590b3a7a03d4e065d93d4 (patch)
treea656cf7a2cec54ed3ff0ff28df4c9176c0228763 /Documentation/userspace-api/netlink/intro.rst
parentnetlink: factor out extack composition (diff)
downloadlinux-dev-690252f19f0e486abb8590b3a7a03d4e065d93d4.tar.xz
linux-dev-690252f19f0e486abb8590b3a7a03d4e065d93d4.zip
netlink: add support for ext_ack missing attributes
There is currently no way to report via extack in a structured way that an attribute is missing. This leads to families resorting to string messages. Add a pair of attributes - @offset and @type for machine-readable way of reporting missing attributes. The @offset points to the nest which should have contained the attribute, @type is the expected nla_type. The offset will be skipped if the attribute is missing at the message level rather than inside a nest. User space should be able to figure out which attribute enum (AKA attribute space AKA attribute set) the nest pointed to by @offset is using. Reviewed-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'Documentation/userspace-api/netlink/intro.rst')
-rw-r--r--Documentation/userspace-api/netlink/intro.rst7
1 files changed, 5 insertions, 2 deletions
diff --git a/Documentation/userspace-api/netlink/intro.rst b/Documentation/userspace-api/netlink/intro.rst
index 94337f79e077..8f1220756412 100644
--- a/Documentation/userspace-api/netlink/intro.rst
+++ b/Documentation/userspace-api/netlink/intro.rst
@@ -359,8 +359,8 @@ compatibility this feature has to be explicitly enabled by setting
the ``NETLINK_EXT_ACK`` setsockopt() to ``1``.
Types of extended ack attributes are defined in enum nlmsgerr_attrs.
-The two most commonly used attributes are ``NLMSGERR_ATTR_MSG``
-and ``NLMSGERR_ATTR_OFFS``.
+The most commonly used attributes are ``NLMSGERR_ATTR_MSG``,
+``NLMSGERR_ATTR_OFFS`` and ``NLMSGERR_ATTR_MISS_*``.
``NLMSGERR_ATTR_MSG`` carries a message in English describing
the encountered problem. These messages are far more detailed
@@ -368,6 +368,9 @@ than what can be expressed thru standard UNIX error codes.
``NLMSGERR_ATTR_OFFS`` points to the attribute which caused the problem.
+``NLMSGERR_ATTR_MISS_TYPE`` and ``NLMSGERR_ATTR_MISS_NEST``
+inform about a missing attribute.
+
Extended ACKs can be reported on errors as well as in case of success.
The latter should be treated as a warning.