const struct xt_counters *counters,
bool basechain, uint32_t refs)
{
- printf("Bridge chain: %s, entries: %u, policy: %s\n", chain, refs, pol);
+ printf("Bridge chain: %s, entries: %u, policy: %s\n",
+ chain, refs, basechain ? pol : "RETURN");
}
static void nft_bridge_print_firewall(struct nft_rule *r, unsigned int num,
case 'E': /* Rename chain */
case 'X': /* Delete chain */
/* We allow -N chainname -P policy */
+ /* XXX: Not in ebtables-compat */
if (command == 'N' && c == 'P') {
command = c;
optind--; /* No table specified */
cs.fw.ethproto = htons(cs.fw.ethproto);
if (command == 'P') {
- if (selected_chain < NF_BR_NUMHOOKS && strcmp(policy, "RETURN")==0)
+ if (selected_chain < 0) {
+ xtables_error(PARAMETER_PROBLEM,
+ "Policy %s not allowed for user defined chains",
+ policy);
+ }
+ if (strcmp(policy, "RETURN") == 0) {
xtables_error(PARAMETER_PROBLEM,
"Policy RETURN only allowed for user defined chains");
+ }
ret = nft_chain_set(h, *table, chain, policy, NULL);
if (ret < 0)
xtables_error(PARAMETER_PROBLEM, "Wrong policy");