summaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/api_errno.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/vnet/api_errno.h b/src/vnet/api_errno.h
index 4e91e132b89..60e48f4a779 100644
--- a/src/vnet/api_errno.h
+++ b/src/vnet/api_errno.h
@@ -35,6 +35,8 @@ format_function_t format_vnet_api_errno;
static_always_inline vnet_api_error_t
vnet_api_error (clib_error_t *err)
{
+ if (err == 0)
+ return 0;
if (err->code >= 0)
return VNET_API_ERROR_BUG;
return err->code;