const struct xt_xlate_mt_params *params)
{
struct xt_comment_info *commentinfo = (void *)params->match->data;
+ char comment[XT_MAX_COMMENT_LEN];
commentinfo->comment[XT_MAX_COMMENT_LEN - 1] = '\0';
- xt_xlate_add_comment(xl, commentinfo->comment);
+ if (params->escape_quotes)
+ snprintf(comment, XT_MAX_COMMENT_LEN, "\\\"%s\\\"",
+ commentinfo->comment);
+ else
+ snprintf(comment, XT_MAX_COMMENT_LEN, "\"%s\"",
+ commentinfo->comment);
+
+ comment[XT_MAX_COMMENT_LEN - 1] = '\0';
+ xt_xlate_add_comment(xl, comment);
return 1;
}
comment = xt_xlate_get_comment(xl);
if (comment)
- xt_xlate_add(xl, "comment \\\"%s\\\" ", comment);
+ xt_xlate_add(xl, "comment %s", comment);
ret = xlate_action(cs, !!(cs->fw.ip.flags & IPT_F_GOTO), xl);
comment = xt_xlate_get_comment(xl);
if (comment)
- xt_xlate_add(xl, "comment \\\"%s\\\" ", comment);
+ xt_xlate_add(xl, "comment %s", comment);
ret = xlate_action(cs, !!(cs->fw6.ipv6.flags & IP6T_F_GOTO), xl);