Chain lookup needs a name, not a numerical id.
After patch, loading bogon gives following errors:
Error: No symbol type information a b index 1 10.1.26.a
v2: Don't return an error, just make it a no-op (Pablo Neira Ayuso)
Fixes: c330152b7f77 ("src: support for implicit chain bindings")
Signed-off-by: Florian Westphal <fw@strlen.de>
if (!table)
return table_not_found(ctx);
+ /* chain is anonymous, adding new rules via index is not supported. */
+ if (!rule->handle.chain.name)
+ return 0;
+
chain = chain_cache_find(table, rule->handle.chain.name);
if (!chain)
return chain_not_found(ctx);
--- /dev/null
+table ip f {
+ chain c {
+ jump {
+ accept
+ }
+ }
+}
+a b index 1 10.1.26.a