From 0db7b6c58af45a880e3974596201af80b6d3da75 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Sun, 18 Nov 2012 15:45:58 -0800 Subject: [PATCH] Don't require a parameter with '&' Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Rules.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Rules.pm b/Shorewall/Perl/Shorewall/Rules.pm index cdcaaa136..a076b2164 100644 --- a/Shorewall/Perl/Shorewall/Rules.pm +++ b/Shorewall/Perl/Shorewall/Rules.pm @@ -1535,7 +1535,7 @@ sub use_policy_action( $ ) { # # Expand a macro rule from the rules file # -sub process_macro ( $$$$$$$$$$$$$$$$$$$) { +sub process_macro ($$$$$$$$$$$$$$$$$$$) { my ($macro, $chainref, $target, $param, $source, $dest, $proto, $ports, $sports, $origdest, $rate, $user, $mark, $connlimit, $time, $headers, $condition, $helper, $wildcard ) = @_; my $nocomment = no_comment; @@ -1589,8 +1589,11 @@ sub process_macro ( $$$$$$$$$$$$$$$$$$$) { } if ( $mtarget =~ s/&$// ) { - fatal_error "$mtarget& requires a parameter to be supplied in macro invocation" unless $param ne ''; - $mtarget = "$mtarget:$macro($param)"; + if ( supplied $param ) { + $mtarget = "$mtarget:$macro($param)"; + } else { + $mtarget = "$mtarget:$macro"; + } } my $action = isolate_basic_target $mtarget;