Révision bd8baa0f
Fix IPv4 source address type detection
Before this patch, a rule like this:
```
nftables::simplerule { 'foo':
action => 'accept',
dport => 443,
proto => 'tcp4',
saddr => '192.168.1.10',
}
```
would incorrectly generate this rule:
```
ip version 4 tcp dport {443} ip6 saddr 192.168.1.10 accept
```
Note the 'ip6 saddr'.
spec/defines/simplerule_spec.rb | ||
---|---|---|
209 | 209 |
} |
210 | 210 |
end |
211 | 211 |
|
212 |
describe 'with an IPv4 address as saddr' do |
|
213 |
let(:params) do |
|
214 |
{ |
|
215 |
saddr: '172.16.1.5', |
|
216 |
} |
|
217 |
end |
|
218 |
|
|
219 |
it { is_expected.to compile } |
|
220 |
it { |
|
221 |
is_expected.to contain_nftables__rule('default_in-my_default_rule_name').with( |
|
222 |
content: 'ip saddr 172.16.1.5 accept', |
|
223 |
) |
|
224 |
} |
|
225 |
end |
|
226 |
|
|
212 | 227 |
describe 'with an IPv6 set as daddr, default set_type' do |
213 | 228 |
let(:params) do |
214 | 229 |
{ |
Formats disponibles : Unified diff