Skip to content

Commit

Permalink
ofproto-dpif-xlate: Fix VLOG_ERR_RL() call.
Browse files Browse the repository at this point in the history
a716ef9 ("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 <[email protected]>
Signed-off-by: Joe Stringer <[email protected]>
Acked-by: Daniele Di Proietto <[email protected]>
  • Loading branch information
joestringer committed Aug 12, 2016
1 parent a716ef9 commit 26f858a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ofproto/ofproto-dpif-xlate.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 26f858a

Please sign in to comment.