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'.
templates/simplerule.epp | ||
---|---|---|
38 | 38 |
<%- if $saddr { |
39 | 39 |
if $saddr =~ Stdlib::IP::Address::V6 { |
40 | 40 |
$_src_hosts = "ip6 saddr ${saddr}" |
41 |
} elsif $daddr =~ Stdlib::IP::Address::V4 {
|
|
41 |
} elsif $saddr =~ Stdlib::IP::Address::V4 {
|
|
42 | 42 |
$_src_hosts = "ip saddr ${saddr}" |
43 | 43 |
} else { |
44 | 44 |
$_src_hosts = $set_type ? { |
Formats disponibles : Unified diff