]> git.proxmox.com Git - ovs.git/commitdiff
odp-util: Improve formatting of bogus empty action attributes.
authorBen Pfaff <blp@nicira.com>
Tue, 11 Jan 2011 23:35:56 +0000 (15:35 -0800)
committerBen Pfaff <blp@nicira.com>
Thu, 27 Jan 2011 17:26:06 +0000 (09:26 -0800)
Before this change, these were formatted as:
,***%u leftover bytes***
After this change, they are formatted as:
<empty>,***%u leftover bytes***

Reviewed by Ethan Jackson <ethan@nicira.com>.

lib/odp-util.c

index 29f536dae2173dd79591d311dfefece36f5bc8a8..dc6843fb5396fa27409d04d76209493cfb74eea4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2010 Nicira Networks.
+ * Copyright (c) 2009, 2010, 2011 Nicira Networks.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -187,6 +187,9 @@ format_odp_actions(struct ds *ds, const struct nlattr *actions,
             format_odp_action(ds, a);
         }
         if (left) {
+            if (left == actions_len) {
+                ds_put_cstr(ds, "<empty>");
+            }
             ds_put_format(ds, " ***%u leftover bytes***", left);
         }
     } else {