Commit f5c266b
committed
Make options for '-m rpfilter' work correctly
Parse the trailing arguments to '-m rpfilter' out of existing rules.
Prior behavior included the '--' prefix along with the options
themselves when pulling them out of the rule.
For ip6tables, the provider could not correctly generate an ip6tables
commandline that included '-m rpfilter' at all - its inclusion in the
known booleans array precluded its options being expanded or included at
all.
Additionally:
- Using a comma rather than a space as a separator character in the
pre-parse munging doesn't require any quotes, nor does it require any
new post-parse munging when there is already an existing iterator to
handle splitting of comma-separated multiple elements into arrays
- '-m rpfilter' on its own is supposed to be valid, and in fact is used
in exactly this style of invocation in the examples included in 'man
iptables-extensions'; but support for '-m rpfilter' in this module is
limited to uses that include one or more modifying arguments. When
this is eventually fixed (which I do not have time to do right now),
the updated pre-parse munge logic will work with no further alteration
- Adjusting the regex used by String#scan to capture the arguments to
treat its capture groups differently SIGNIFICANTLY simplifies the
logic around substitutions for the pre-parse munge such that no
additional branching is required, and the operation is still safe1 parent 18f575b commit f5c266b
2 files changed
+4
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | | - | |
247 | 246 | | |
248 | 247 | | |
249 | 248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
581 | 581 | | |
582 | 582 | | |
583 | 583 | | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | | - | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
593 | 587 | | |
594 | 588 | | |
595 | 589 | | |
| |||
681 | 675 | | |
682 | 676 | | |
683 | 677 | | |
684 | | - | |
| 678 | + | |
685 | 679 | | |
686 | 680 | | |
687 | 681 | | |
688 | 682 | | |
689 | 683 | | |
690 | 684 | | |
691 | 685 | | |
692 | | - | |
693 | | - | |
694 | 686 | | |
695 | 687 | | |
696 | 688 | | |
| |||
0 commit comments