]> git.proxmox.com Git - mirror_ovs.git/commitdiff
ofproto-dpif-xlate: Fix VLOG_ERR_RL() call.
authorJoe Stringer <joe@ovn.org>
Fri, 12 Aug 2016 00:54:08 +0000 (17:54 -0700)
committerJoe Stringer <joe@ovn.org>
Fri, 12 Aug 2016 01:02:57 +0000 (18:02 -0700)
a716ef9a7a73 ("ofproto-dpif-xlate: Log flow in XLATE_REPORT_ERROR.")
inadvertantly broke build on clang due to improper passing of the ds
cstring into the VLOG() function:

error: format string is not a string literal
      (potentially insecure) [-Werror,-Wformat-security]
        XLATE_REPORT_ERROR(ctx, "over max translation depth %d", MAX_DEPTH);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
note: expanded from macro
      'XLATE_REPORT_ERROR'
            VLOG_ERR_RL(&error_report_rl, ds_cstr(&ds));        \

Reported-by: Daniele Di Proietto <diproiettod@vmware.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
ofproto/ofproto-dpif-xlate.c

index 1e375b58f1951d3f98668bcc84f89136d2a2ab7e..f0a25011fc426c7cc73db72880653dae09b94d5e 100644 (file)
@@ -637,7 +637,7 @@ static struct vlog_rate_limit error_report_rl = VLOG_RATE_LIMIT_INIT(1, 5);
             ds_put_format(&ds, __VA_ARGS__);                    \
             ds_put_cstr(&ds, ": ");                             \
             flow_format(&ds, &ctx->base_flow);                  \
-            VLOG_ERR_RL(&error_report_rl, ds_cstr(&ds));        \
+            VLOG_ERR_RL(&error_report_rl, "%s", ds_cstr(&ds));  \
             ds_destroy(&ds);                                    \
         }                                                       \
     } while (0)