]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
Support IPv6 NAT in kernels with major version greater than, and equal to, 3.7.
authorNathan Ward <nathan@primoris.co.nz>
Sun, 1 Nov 2015 03:05:56 +0000 (16:05 +1300)
committerNathan Ward <nathan@primoris.co.nz>
Sun, 1 Nov 2015 03:05:56 +0000 (16:05 +1300)
lib/puppet/type/firewallchain.rb

index cb2c61412b3c8e31feff97ea6c0114005604db23..cca48b770df354968ab503539ae58d90eeab418d 100644 (file)
@@ -59,7 +59,7 @@ Puppet::Type.newtype(:firewallchain) do
           if chain =~ /^(BROUTING|FORWARD)$/
             raise ArgumentError, "PREROUTING, POSTROUTING, INPUT, and OUTPUT are the only inbuilt chains that can be used in table 'nat'"
           end
-          if protocol =~/^(IP(v6)?)?$/
+          if Gem::Version.new(Facter['kernelmajversion'].value) < Gem::Version.new('3.7') and protocol =~/^(IP(v6)?)?$/
             raise ArgumentError, "table nat isn't valid in IPv6. You must specify ':IPv4' as the name suffix"
           end
         when 'raw'