Now that we have extended error reporting and a new message format for netlink ACK messages, also extend this to be able to return arbitrary cookie data on success. This will allow, for example, nl80211 to not send an extra message for cookies identifying newly created objects, but return those directly in the ACK message. The cookie data size is currently limited to 20 bytes (since Jamal talked about using SHA1 for identifiers.) Thanks to Jamal Hadi Salim for bringing up this idea during the discussions.
Showing the changes to include/uapi/linux (1 of 3 files). Show all
Unified · Split
| @@ -122,6 +122,9 @@ struct nlmsgerr { · 121 unmodified lines | |||
| 122 | * @NLMSGERR_ATTR_MSG: error message string (string) | 122 | * @NLMSGERR_ATTR_MSG: error message string (string) |
| 123 | * @NLMSGERR_ATTR_OFFS: offset of the invalid attribute in the original | 123 | * @NLMSGERR_ATTR_OFFS: offset of the invalid attribute in the original |
| 124 | * message, counting from the beginning of the header (u32) | 124 | * message, counting from the beginning of the header (u32) |
| 125 | * @NLMSGERR_ATTR_COOKIE: arbitrary subsystem specific cookie to | ||
| 126 | * be used - in the success case - to identify a created | ||
| 127 | * object or operation or similar (binary) | ||
| 125 | * @__NLMSGERR_ATTR_MAX: number of attributes | 128 | * @__NLMSGERR_ATTR_MAX: number of attributes |
| 126 | * @NLMSGERR_ATTR_MAX: highest attribute number | 129 | * @NLMSGERR_ATTR_MAX: highest attribute number |
| 127 | */ | 130 | */ |
| @@ -129,6 +132,7 @@ enum nlmsgerr_attrs { · 1 unmodified line | |||
| 129 | NLMSGERR_ATTR_UNUSED, | 132 | NLMSGERR_ATTR_UNUSED, |
| 130 | NLMSGERR_ATTR_MSG, | 133 | NLMSGERR_ATTR_MSG, |
| 131 | NLMSGERR_ATTR_OFFS, | 134 | NLMSGERR_ATTR_OFFS, |
| 135 | NLMSGERR_ATTR_COOKIE, | ||
| 132 | 136 | ||
| 133 | __NLMSGERR_ATTR_MAX, | 137 | __NLMSGERR_ATTR_MAX, |
| 134 | NLMSGERR_ATTR_MAX = __NLMSGERR_ATTR_MAX - 1 | 138 | NLMSGERR_ATTR_MAX = __NLMSGERR_ATTR_MAX - 1 |