summaryrefslogtreecommitdiff
path: root/build-aux/extract-ofp-errors
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2012-09-05 10:18:56 -0700
committerBen Pfaff <blp@nicira.com>2012-09-05 10:19:02 -0700
commit55c2b94431412e6ffb2010bad230f68373109e07 (patch)
tree7bb25ebafaf90386c4c20bf808fe6f81eca32905 /build-aux/extract-ofp-errors
parent4b83c93f19424c4b7c02c8ce25f2a689fc6a7369 (diff)
downloadopenvswitch-55c2b94431412e6ffb2010bad230f68373109e07.tar.gz
extract-ofp-errors: Check that error codes are in the expected ranges.
All real OpenFlow error codes are small numbers, and for Nicira extensions we've intentionally chosen large numbers. This commit adds a check that standard and extension codes are properly designated in the ofp-errors.h header. Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'build-aux/extract-ofp-errors')
-rwxr-xr-xbuild-aux/extract-ofp-errors5
1 files changed, 5 insertions, 0 deletions
diff --git a/build-aux/extract-ofp-errors b/build-aux/extract-ofp-errors
index bd4ab9ed5..db28af839 100755
--- a/build-aux/extract-ofp-errors
+++ b/build-aux/extract-ofp-errors
@@ -238,6 +238,11 @@ def extract_ofp_errors(filenames):
"NX1.2": ("OF1.2",)}
if targets not in target_map:
fatal("%s: unknown error domain" % targets)
+ if targets.startswith('NX') and code < 0x100:
+ fatal("%s: NX domain code cannot be less than 0x100" % dst)
+ if targets.startswith('OF') and code >= 0x100:
+ fatal("%s: OF domain code cannot be greater than 0x100"
+ % dst)
for target in target_map[targets]:
domain[target].setdefault(type_, {})
if code in domain[target][type_]: