summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-03-19 11:22:12 (GMT)
committerThomas Haller <thaller@redhat.com>2015-03-19 11:26:53 (GMT)
commit860ea27a466cfbe1fdc879ef9eb6e67fb5eaae21 (patch)
tree5a4b9b8b2219ccba47370a7daefa1d76f65d5d4a /lib
parentff19c781d3b655aba3dcf07a68537c7bae2468b5 (diff)
downloadlibnl-860ea27a466cfbe1fdc879ef9eb6e67fb5eaae21.zip
libnl-860ea27a466cfbe1fdc879ef9eb6e67fb5eaae21.tar.gz
libnl-860ea27a466cfbe1fdc879ef9eb6e67fb5eaae21.tar.bz2
utils: add code comment about capability number assignment
Also reserve a range of capabilities (0x7000 to 0x7FFF) that we won't use upstream. Add a macro NL_CAPABILITY_IS_USER_RESERVED() to check if the capability is in that range. Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/utils.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/utils.c b/lib/utils.c
index 5e853f1..22f5f42 100644
--- a/lib/utils.c
+++ b/lib/utils.c
@@ -1152,6 +1152,20 @@ int nl_has_capability (int capability)
NL_CAPABILITY_ROUTE_ADDR_COMPARE_CACHEINFO,
0,
0),
+ /* IMPORTANT: these capability numbers are intended to be universal and stable
+ * for libnl3. Don't allocate new numbers on your own that differ from upstream
+ * libnl3.
+ *
+ * Instead register a capability number upstream too. We will take patches
+ * for that. We especially take patches to register a capability number that is
+ * only implemented in your fork of libnl3.
+ *
+ * If you really don't want that, use capabilities in the range 0x7000 to 0x7FFF.
+ * (NL_CAPABILITY_IS_USER_RESERVED). Upstream libnl3 will not register conflicting
+ * capabilities in that range.
+ *
+ * Obviously, only backport capability numbers to libnl versions that actually
+ * implement that capability as well. */
#undef _NL_SET
#undef _NL_SETV
#undef _NL_ASSERT