Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rpfilter parameter #1013

Merged
merged 4 commits into from
May 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/puppet/provider/firewall/ip6tables.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
has_feature :queue_num
has_feature :queue_bypass
has_feature :ct_target
has_feature :rpfilter

optional_commands(ip6tables: 'ip6tables',
ip6tables_save: 'ip6tables-save')
Expand All @@ -66,6 +65,11 @@
has_feature :random_fully
end

if (kernelversion && Puppet::Util::Package.versioncmp(kernelversion, '3.3') >= 0) &&
(ip6tables_version && Puppet::Util::Package.versioncmp(ip6tables_version, '1.4.13') >= 0)
has_feature :rpfilter
end

def initialize(*args)
ip6tables_version = Facter.value('ip6tables_version')
raise ArgumentError, 'The ip6tables provider is not supported on version 1.3 of iptables' if ip6tables_version&.match(%r{1\.3\.\d})
Expand Down
6 changes: 5 additions & 1 deletion lib/puppet/provider/firewall/iptables.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
has_feature :queue_bypass
has_feature :ipvs
has_feature :ct_target
has_feature :rpfilter

optional_commands(iptables: 'iptables',
iptables_save: 'iptables-save')
Expand All @@ -72,6 +71,11 @@
has_feature :random_fully
end

if (kernelversion && Puppet::Util::Package.versioncmp(kernelversion, '3.3') >= 0) &&
(iptables_version && Puppet::Util::Package.versioncmp(iptables_version, '1.4.13') >= 0)
has_feature :rpfilter
end

@protocol = 'IPv4'

@resource_map = {
Expand Down
1 change: 1 addition & 0 deletions lib/puppet/type/firewall.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@
feature :mss, 'Match a given TCP MSS value or range.'
feature :tcp_flags, 'The ability to match on particular TCP flag settings'
feature :pkttype, 'Match a packet type'
feature :rpfilter, 'Perform reverse-path filtering'
feature :socket, 'Match open sockets'
feature :isfragment, 'Match fragments'
feature :address_type, 'The ability match on source or destination address type'
Expand Down