diff --git a/src/firewall/core/base.py b/src/firewall/core/base.py index ad74a1d..fad91b6 100644 --- a/src/firewall/core/base.py +++ b/src/firewall/core/base.py @@ -18,10 +18,13 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -import os -(major, minor, release) = os.uname()[2].split('.', 2) + +# Check if kernel supports IPv6 NAT # http://kernelnewbies.org/Linux_3.7 -IPV6_NAT = int(major) >= 3 and int(minor) >= 7 +for line in open("/proc/kallsyms"): + if "nf_nat_ipv6" in line: + IPV6_NAT = True + break DEFAULT_ZONE_TARGET = "{chain}_{zone}" ZONE_TARGETS = [ "ACCEPT", "%%REJECT%%", "DROP", DEFAULT_ZONE_TARGET ]