$value = $$hash{$key}[6];
}
- if ($addr_type ~~ ["cust_grp_src", "cust_grp_tgt"]) {
- foreach my $grp (sort {$a <=> $b} keys %customgrp) {
- if ($customgrp{$grp}[0] eq $value) {
- my @address = &get_address($customgrp{$grp}[3], $customgrp{$grp}[2], $type);
- next if ($address[0][0] eq 'none');
- if (@address) {
- push(@addresses, @address);
- }
- }
- }
- }elsif ($addr_type ~~ ["cust_location_src", "cust_location_tgt"] && $value =~ "group:") {
+ if ($addr_type ~~ ["cust_location_src", "cust_location_tgt"] && $value =~ "group:") {
$value=substr($value,6);
foreach my $grp (sort {$a <=> $b} keys %customlocationgrp) {
if ($customlocationgrp{$grp}[0] eq $value) {
push(@ret, ["-m set --match-set $value dst", "$external_interface"]);
}
+ # Handle rule option with a custom source group.
+ } elsif ($key eq "cust_grp_src") {
+ push(@ret, ["-m set --match-set $value src", ""]);
+
+ # Handle rule option with a custom destination group.
+ } elsif ($key eq "cust_grp_dst") {
+ push(@ret, ["-m set --match-set $value dst", ""]);
+
# If nothing was selected, we assume "any".
} else {
push(@ret, ["0/0", ""]);