doc/netlink: Describe sub-message selector resolution
authorDonald Hunter <donald.hunter@gmail.com>
Mon, 29 Jan 2024 22:34:48 +0000 (22:34 +0000)
committerJakub Kicinski <kuba@kernel.org>
Thu, 1 Feb 2024 05:19:18 +0000 (21:19 -0800)
Update the netlink-raw docs to add a description of sub-message selector
resolution to explain that selector resolution is constrained by the
spec.

Signed-off-by: Donald Hunter <donald.hunter@gmail.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Link: https://lore.kernel.org/r/20240129223458.52046-4-donald.hunter@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Documentation/userspace-api/netlink/netlink-raw.rst

index 1e14f5f22b8e0fc85e0c7d0c431efeda69c32574..32197f3cb40e5a9e28ceffc3881d0249225d4d11 100644 (file)
@@ -150,3 +150,11 @@ attributes from an ``attribute-set``. For example the following
 
 Note that a selector attribute must appear in a netlink message before any
 sub-message attributes that depend on it.
+
+If an attribute such as ``kind`` is defined at more than one nest level, then a
+sub-message selector will be resolved using the value 'closest' to the selector.
+For example, if the same attribute name is defined in a nested ``attribute-set``
+alongside a sub-message selector and also in a top level ``attribute-set``, then
+the selector will be resolved using the value 'closest' to the selector. If the
+value is not present in the message at the same level as defined in the spec
+then this is an error.