Skip to content

Commit 169e693

Browse files
authored
Merge pull request #1201 from puppetlabs/MODULES-11449-ipv6-nat-chain-issue
(MODULES-11449) - Fix for IPv6 NAT chain
2 parents ac201ca + b1f5e4d commit 169e693

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

Diff for: lib/puppet/provider/firewallchain/firewallchain.rb

-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ def self.verify(_is, should)
172172
raise ArgumentError, 'PREROUTING, POSTROUTING, INPUT, FORWARD and OUTPUT are the only inbuilt chains that can be used in table \'mangle\'' if %r{^(BROUTING)$}.match?(should[:chain])
173173
when 'nat'
174174
raise ArgumentError, 'PREROUTING, POSTROUTING, INPUT, and OUTPUT are the only inbuilt chains that can be used in table \'nat\'' if %r{^(BROUTING|FORWARD)$}.match?(should[:chain])
175-
raise ArgumentError, 'table nat isn\'t valid in IPv6. You must specify \':IPv4\' as the name suffix' if %r{^(IP(v6)?)?$}.match?(should[:protocol])
176175
when 'raw'
177176
raise ArgumentError, 'PREROUTING and OUTPUT are the only inbuilt chains in the table \'raw\'' if %r{^(POSTROUTING|BROUTING|INPUT|FORWARD)$}.match?(should[:chain])
178177
when 'broute'

Diff for: spec/acceptance/firewallchain_spec.rb

+12
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,18 @@
8282
end
8383
end
8484
end
85+
86+
context 'with NAT chain' do
87+
pp3 = <<-PUPPETCODE
88+
firewallchain { 'MY_CHAIN:nat:IPv6':
89+
ensure => present,
90+
}
91+
PUPPETCODE
92+
it 'applies cleanly' do
93+
# Run it twice and test for idempotency
94+
idempotent_apply(pp3)
95+
end
96+
end
8597
end
8698

8799
# XXX purge => false is not yet implemented

Diff for: spec/unit/puppet/provider/firewallchain/firewallchain_spec.rb

-4
Original file line numberDiff line numberDiff line change
@@ -316,10 +316,6 @@
316316
should: { name: 'FORWARD:nat:IPv4', chain: 'FORWARD', table: 'nat', protocol: 'IPv4', ensure: 'present', policy: 'accept' },
317317
error: 'PREROUTING, POSTROUTING, INPUT, and OUTPUT are the only inbuilt chains that can be used in table \'nat\''
318318
},
319-
{
320-
should: { name: 'PREROUTING:nat:IPv6', chain: 'PREROUTING', table: 'nat', protocol: 'IPv6', ensure: 'present', policy: 'accept' },
321-
error: 'table nat isn\'t valid in IPv6. You must specify \':IPv4\' as the name suffix'
322-
},
323319
{
324320
should: { name: 'INPUT:raw:IPv4', chain: 'INPUT', table: 'raw', protocol: 'IPv4', ensure: 'present', policy: 'accept' },
325321
error: 'PREROUTING and OUTPUT are the only inbuilt chains in the table \'raw\''

0 commit comments

Comments
 (0)