[ovs-dev] [PATCH] odp-util: Only add recirc_id mask to Netlink message if mask is provided

Thomas Graf tgraf at noironetworks.com
Tue Aug 26 16:34:52 UTC 2014


Current unconditional call may result in NULL being passed to
nl_msg_put_u32().

Cc: Andy Zhou <azhou at nicira.com>
Signed-off-by: Thomas Graf <tgraf at noironetworks.com>
---
 lib/odp-util.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/odp-util.c b/lib/odp-util.c
index 19d0627..8a96068 100644
--- a/lib/odp-util.c
+++ b/lib/odp-util.c
@@ -1755,7 +1755,9 @@ parse_odp_key_mask_attr(const char *s, const struct simap *port_names,
 
         if (ovs_scan(s, "recirc_id(%"SCNi32")%n", &recirc_id, &n)) {
             nl_msg_put_u32(key, OVS_KEY_ATTR_RECIRC_ID, recirc_id);
-            nl_msg_put_u32(mask, OVS_KEY_ATTR_RECIRC_ID, UINT32_MAX);
+            if (mask) {
+                nl_msg_put_u32(mask, OVS_KEY_ATTR_RECIRC_ID, UINT32_MAX);
+            }
             return n;
         }
     }
-- 
1.9.3




More information about the dev mailing list