iptables: Add duplicate chain check to iptables_add_chain().

This commit adds a check to iptables_add_chain() before new chain is added. If
a chain with same name is found -EEXIST will be returned.

Without this, e.g., chain INPUT can be duplicated to iptables filter table and
it cannot be removed with iptables_remove_chain() or iptables -X. After boot
the duplicate builtin chain is removed.
1 file changed