Skip to content

Commit ed26196

Browse files
Treat tcpmss match extension as a match extension
The ip[6]tables providers understand handling extension modules; treat tcpmss as an extension module, rather than mangling its matcher
1 parent 1f8488f commit ed26196

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

lib/puppet/provider/firewall/ip6tables.rb

+4-3
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def self.iptables_save(*args)
142142
match_mark: '-m mark --mark',
143143
name: '-m comment --comment',
144144
mac_source: ['-m mac --mac-source', '--mac-source'],
145-
mss: '-m tcpmss --mss',
145+
mss: '--mss',
146146
nflog_group: '--nflog-group',
147147
nflog_prefix: '--nflog-prefix',
148148
nflog_range: '--nflog-range',
@@ -276,6 +276,7 @@ def self.iptables_save(*args)
276276
iprange: [:src_range, :dst_range],
277277
owner: [:uid, :gid],
278278
condition: [:condition],
279+
tcpmss: [:mss],
279280
conntrack: [:ctstate, :ctproto, :ctorigsrc, :ctorigdst, :ctreplsrc, :ctrepldst,
280281
:ctorigsrcport, :ctorigdstport, :ctreplsrcport, :ctrepldstport, :ctstatus, :ctexpire, :ctdir],
281282
time: [:time_start, :time_stop, :month_days, :week_days, :date_start, :date_stop, :time_contiguous, :kernel_timezone],
@@ -357,8 +358,8 @@ def self.iptables_save(*args)
357358
context_start: '-j SYNPROXY',
358359
},
359360
mss: {
360-
# Extra starting space because the matcher for :mss includes '-m tcpmss',
361-
# and the search for it prefixes the matcher with a space
361+
# Extra starting space because '-m tcpmss' gets prepended to the matcher for :mss before parse,
362+
# and the search for it while building the parser list prefixes the matcher with a space
362363
context_start: ' -m tcpmss',
363364
context_end: %r{ -[mgj] },
364365
},

lib/puppet/provider/firewall/iptables.rb

+4-3
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
mac_source: ['-m mac --mac-source', '--mac-source'],
131131
mask: '--mask',
132132
match_mark: '-m mark --mark',
133-
mss: '-m tcpmss --mss',
133+
mss: '--mss',
134134
name: '-m comment --comment',
135135
nflog_group: '--nflog-group',
136136
nflog_prefix: '--nflog-prefix',
@@ -276,6 +276,7 @@
276276
iprange: [:src_range, :dst_range],
277277
owner: [:uid, :gid],
278278
condition: [:condition],
279+
tcpmss: [:mss],
279280
conntrack: [:ctstate, :ctproto, :ctorigsrc, :ctorigdst, :ctreplsrc, :ctrepldst,
280281
:ctorigsrcport, :ctorigdstport, :ctreplsrcport, :ctrepldstport, :ctstatus, :ctexpire, :ctdir],
281282
time: [:time_start, :time_stop, :month_days, :week_days, :date_start, :date_stop, :time_contiguous, :kernel_timezone],
@@ -393,8 +394,8 @@ def munge_resource_map_from_resource(resource_map_original, compare)
393394
context_start: '-j SYNPROXY',
394395
},
395396
mss: {
396-
# Extra starting space because the matcher for :mss includes '-m tcpmss',
397-
# and the search for it prefixes the matcher with a space
397+
# Extra starting space because '-m tcpmss' gets prepended to the matcher for :mss before parse,
398+
# and the search for it while building the parser list prefixes the matcher with a space
398399
context_start: ' -m tcpmss',
399400
context_end: %r{ -[mgj] },
400401
},

0 commit comments

Comments
 (0)