udp: fix csum computation when offload disabled
[vpp.git] / src / vnet / api_errno.h
index 4e91e13..52f201c 100644 (file)
@@ -35,11 +35,21 @@ 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;
 }
 
+static_always_inline vnet_api_error_t
+vnet_get_api_error_and_free (clib_error_t *err)
+{
+  vnet_api_error_t rv = vnet_api_error (err);
+  clib_error_free (err);
+  return rv;
+}
+
 #endif /* included_vnet_api_errno_h */
 
 /*