summaryrefslogtreecommitdiff
path: root/regress/case-unknown-flags-init.err
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2014-10-24 21:36:36 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2014-10-26 11:42:43 +0000
commit039a0566b2e321bbfcb51f667d32b5d890ee6f61 (patch)
treec4ebb2134c68e06692d3bedc5fd76c37db5ce141 /regress/case-unknown-flags-init.err
parenta7f55cc47fd1a8c9d6e9e5eea2fc4184bfe7ad1c (diff)
API: Reject unknown flags
Check for unknown flags in adns_initflags, adns_queryflags, and adns_rrtype. This will allow us to extend the API in the future but still retain backward-ABI-safety: new applications which pass a new flag but are run against old adns will get an error (typically, ENOSYS). In each case we reserve a few of the spare bits for `harmless' extensions: flags which we decide, at the time of introduction, that it is harmless for old implementations to ignore. We simply provide explicit hex values for the flags. This is easier than listing all of the actually-defined flags, and probably no less reliable. Failing to add a new flag to the check as well as to the enum will produce an obvious error (unless the `harmless' flag is used - and those are at the top of the space to reduce that probability). In the case of adns_rrtype, all of the external functions quickly pass the type to adns__findtype, so we can do the check there. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'regress/case-unknown-flags-init.err')
-rw-r--r--regress/case-unknown-flags-init.err1
1 files changed, 1 insertions, 0 deletions
diff --git a/regress/case-unknown-flags-init.err b/regress/case-unknown-flags-init.err
new file mode 100644
index 0000000..8d1d1d8
--- /dev/null
+++ b/regress/case-unknown-flags-init.err
@@ -0,0 +1 @@
+adns failure: init: errno=ENOSYS