if bool == :isfragment then
# only replace those -f that are not followed by an l to
# distinguish between -f and the '-f' inside of --tcp-flags.
- values = values.sub(/-f(?=[^l])/, '-f true')
+ values = values.sub(/-f(?!l)(?=.*--comment)/, '-f true')
end
end
},
},
'isfragment_option' => {
- :line => '-A INPUT -f -j ACCEPT',
+ :line => '-A INPUT -f -m comment --comment "010 a-f comment with dashf" -j ACCEPT',
:table => 'filter',
:params => {
+ :name => '010 a-f comment with dashf',
:action => 'accept',
:isfragment => true,
},
},
:args => ['-t', :filter, '-p', :all, '-f', '-m', 'comment', '--comment', '050 isfragment option', '-j', 'ACCEPT'],
},
+ 'isfragment_option not changing -f in comment' => {
+ :params => {
+ :name => '050 testcomment-with-fdashf',
+ :table => 'filter',
+ :proto => :all,
+ :action => 'accept',
+ },
+ :args => ['-t', :filter, '-p', :all, '-m', 'comment', '--comment', '050 testcomment-with-fdashf', '-j', 'ACCEPT'],
+ },
}