]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
add string_hex to ip6tables provider. MODULES-10684
authorMark Nejedlo <Mark.Nejedlo@tdstelecom.com>
Mon, 1 Jun 2020 19:01:44 +0000 (14:01 -0500)
committeradrianiurca <adrian.iurca@gmail.com>
Thu, 16 Jul 2020 09:16:15 +0000 (12:16 +0300)
lib/puppet/provider/firewall/ip6tables.rb
spec/fixtures/ip6tables/conversion_hash.rb

index 702072c5e16fc4d6a06423b44323970837e1c061..23b0e9ba6b020771eb154f40fc049f0744912085 100644 (file)
@@ -164,6 +164,7 @@ Puppet::Type.type(:firewall).provide :ip6tables, parent: :iptables, source: :ip6
     stat_probability: '--probability',
     state: '-m state --state',
     string: '-m string --string',
+    string_hex: '-m string --hex-string',
     string_algo: '--algo',
     string_from: '--from',
     string_to: '--to',
@@ -298,7 +299,7 @@ Puppet::Type.type(:firewall).provide :ip6tables, parent: :iptables, source: :ip6
                     :ctstate, :ctproto, :ctorigsrc, :ctorigdst, :ctreplsrc, :ctrepldst,
                     :ctorigsrcport, :ctorigdstport, :ctreplsrcport, :ctrepldstport, :ctstatus, :ctexpire, :ctdir,
                     :icmp, :hop_limit, :limit, :burst, :length, :recent, :rseconds, :reap,
-                    :rhitcount, :rttl, :rname, :mask, :rsource, :rdest, :ipset, :string, :string_algo,
+                    :rhitcount, :rttl, :rname, :mask, :rsource, :rdest, :ipset, :string, :string_hex, :string_algo,
                     :string_from, :string_to, :jump, :nflog_group, :nflog_prefix, :nflog_range, :nflog_threshold, :clamp_mss_to_pmtu, :gateway, :todest,
                     :tosource, :toports, :checksum_fill, :log_level, :log_prefix, :log_uid, :log_tcp_sequence, :log_tcp_options, :log_ip_options,
                     :reject, :set_mss, :set_dscp, :set_dscp_class, :mss, :queue_num, :queue_bypass,
index 0e8d4204819dc6c9b43dc42451d4fd781bf603ad..844bfac5f4ea4a400fc9a1661c1ef031d5c897a4 100644 (file)
@@ -34,6 +34,14 @@ ARGS_TO_HASH6 = {
       dport: ['546'],
     },
   },
+  'hexstring_matching_1' => {
+    line: '-A INPUT -m string --hex-string "|0000FF0001|" --algo bm',
+    table: 'filter',
+    params: {
+      string_hex: '|0000FF0001|',
+      string_algo: 'bm',
+    },
+  }
 }.freeze
 
 # This hash is for testing converting a hash to an argument line.