Xtables2 vs. nftables
Posted Jan 14, 2013 21:54 UTC (Mon) by
paulj (subscriber, #341)
In reply to:
Xtables2 vs. nftables by intgr
Parent article:
Xtables2 vs. nftables
You're badly misrepresenting iptables though. The tables are NOT like goto, they're like functions which can return to the calling chain, in addition to terminating rule processing for the packet. So your iptables example can be factored in several ways. E.g.:
accept_allowed_ssh_hosts () {
if (proto != tcp)
RETURN;
if (port != ssh)
RETURN;
if (ip == 1.2.3.4) ACCEPT;
if (ip == 2.2.2.2) ACCEPT;
if (ip == 3.3.3.3) ACCEPT;
}
And somewhere in INPUT:
accept_allowed_ssh_hosts ();
…
DROP;
Note also the existing iptables language could be compiled to something suitable for a JIT. If there's any control-flow it is missing, it could be added, without throwing away the interface that is there today.
(
Log in to post comments)