Skip to content

Commit d5923f1

Browse files
committed
Reword rule comments
Reword various rule comments to be more explicit and also annotate the flow offloading rule while we're at it. Signed-off-by: Jo-Philipp Wich <[email protected]>
1 parent c1a295a commit d5923f1

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

defaults.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ fw3_print_default_head_rules(struct fw3_ipt_handle *handle,
224224
for (i = 0; i < ARRAY_SIZE(chains); i += 2)
225225
{
226226
r = fw3_ipt_rule_new(handle);
227-
fw3_ipt_rule_comment(r, "user chain for %s", chains[i+1]);
227+
fw3_ipt_rule_comment(r, "Custom %s rule chain", chains[i+1]);
228228
fw3_ipt_rule_target(r, "%s_rule", chains[i+1]);
229229
fw3_ipt_rule_append(r, chains[i]);
230230
}
@@ -233,6 +233,7 @@ fw3_print_default_head_rules(struct fw3_ipt_handle *handle,
233233
if (defs->flow_offloading)
234234
{
235235
r = fw3_ipt_rule_new(handle);
236+
fw3_ipt_rule_comment(r, "Traffic offloading");
236237
fw3_ipt_rule_extra(r, "-m conntrack --ctstate RELATED,ESTABLISHED");
237238
fw3_ipt_rule_target(r, "FLOWOFFLOAD");
238239
fw3_ipt_rule_append(r, "FORWARD");
@@ -288,12 +289,12 @@ fw3_print_default_head_rules(struct fw3_ipt_handle *handle,
288289
if (defs->custom_chains)
289290
{
290291
r = fw3_ipt_rule_new(handle);
291-
fw3_ipt_rule_comment(r, "user chain for prerouting");
292+
fw3_ipt_rule_comment(r, "Custom prerouting rule chain");
292293
fw3_ipt_rule_target(r, "prerouting_rule");
293294
fw3_ipt_rule_append(r, "PREROUTING");
294295

295296
r = fw3_ipt_rule_new(handle);
296-
fw3_ipt_rule_comment(r, "user chain for postrouting");
297+
fw3_ipt_rule_comment(r, "Custom postrouting rule chain");
297298
fw3_ipt_rule_target(r, "postrouting_rule");
298299
fw3_ipt_rule_append(r, "POSTROUTING");
299300
}

forwards.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ print_forward(struct fw3_ipt_handle *handle, struct fw3_forward *forward)
183183
}
184184

185185
r = fw3_ipt_rule_new(handle);
186-
fw3_ipt_rule_comment(r, "forwarding %s -> %s", s, d);
186+
fw3_ipt_rule_comment(r, "Zone %s to %s forwarding policy", s, d);
187187
set_target(r, forward);
188188
append_chain(r, forward);
189189
}

zones.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ print_zone_chain(struct fw3_ipt_handle *handle, struct fw3_state *state,
381381
for (i = 0; i < sizeof(flt_chains)/sizeof(flt_chains[0]); i += 2)
382382
{
383383
r = fw3_ipt_rule_new(handle);
384-
fw3_ipt_rule_comment(r, "user chain for %s", flt_chains[i+1]);
384+
fw3_ipt_rule_comment(r, "Custom %s %s rule chain", zone->name, flt_chains[i+1]);
385385
fw3_ipt_rule_target(r, "%s_%s_rule", flt_chains[i+1], zone->name);
386386
fw3_ipt_rule_append(r, "zone_%s_%s", zone->name, flt_chains[i]);
387387
}
@@ -391,7 +391,7 @@ print_zone_chain(struct fw3_ipt_handle *handle, struct fw3_state *state,
391391
for (i = 0; i < sizeof(nat_chains)/sizeof(nat_chains[0]); i += 2)
392392
{
393393
r = fw3_ipt_rule_new(handle);
394-
fw3_ipt_rule_comment(r, "user chain for %s", nat_chains[i+1]);
394+
fw3_ipt_rule_comment(r, "Custom %s %s rule chain", zone->name, nat_chains[i+1]);
395395
fw3_ipt_rule_target(r, "%s_%s_rule", nat_chains[i+1], zone->name);
396396
fw3_ipt_rule_append(r, "zone_%s_%s", zone->name, nat_chains[i]);
397397
}
@@ -509,7 +509,7 @@ print_interface_rule(struct fw3_ipt_handle *handle, struct fw3_state *state,
509509
fw3_ipt_rule_addarg(r, false, "--tcp-flags", "SYN,RST");
510510
fw3_ipt_rule_addarg(r, false, "SYN", NULL);
511511
fw3_ipt_rule_limit(r, &zone->log_limit);
512-
fw3_ipt_rule_comment(r, "%s (mtu_fix logging)", zone->name);
512+
fw3_ipt_rule_comment(r, "Zone %s MTU fix logging", zone->name);
513513
fw3_ipt_rule_target(r, "LOG");
514514
fw3_ipt_rule_addarg(r, false, "--log-prefix", buf);
515515
fw3_ipt_rule_replace(r, "FORWARD");
@@ -518,7 +518,7 @@ print_interface_rule(struct fw3_ipt_handle *handle, struct fw3_state *state,
518518
r = fw3_ipt_rule_create(handle, &tcp, NULL, dev, NULL, sub);
519519
fw3_ipt_rule_addarg(r, false, "--tcp-flags", "SYN,RST");
520520
fw3_ipt_rule_addarg(r, false, "SYN", NULL);
521-
fw3_ipt_rule_comment(r, "%s (mtu_fix)", zone->name);
521+
fw3_ipt_rule_comment(r, "Zone %s MTU fixing", zone->name);
522522
fw3_ipt_rule_target(r, "TCPMSS");
523523
fw3_ipt_rule_addarg(r, false, "--clamp-mss-to-pmtu", NULL);
524524
fw3_ipt_rule_replace(r, "FORWARD");

0 commit comments

Comments
 (0)