Skip to content

Commit

Permalink
Fixes Aruba ACL network mask
Browse files Browse the repository at this point in the history
  • Loading branch information
fdurand committed Oct 9, 2024
1 parent 3dd2135 commit 3ba9d73
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/pf/Switch/Aruba/ArubaOS_CX_10_x.pm
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ use pf::util;
use pf::util::radius qw(perform_disconnect perform_coa);
use Try::Tiny;
use pf::locationlog;
use NetAddr::IP;

sub description { 'Aruba CX Switch 10.x' }

Expand Down Expand Up @@ -392,7 +393,9 @@ sub acl_chewer {
$dest = "any";
} elsif($acl->{'destination'}->{'ipv4_addr'} ne '0.0.0.0') {
if ($acl->{'destination'}->{'wildcard'} ne '0.0.0.0') {
$dest = $acl->{'destination'}->{'ipv4_addr'}."/".norm_net_mask($acl->{'destination'}->{'wildcard'});
my $net_addr = NetAddr::IP->new($acl->{'destination'}->{'ipv4_addr'}, norm_net_mask($acl->{'destination'}->{'wildcard'}));
my $cidr = $net_addr->cidr();
$dest = $cidr;
} else {
$dest = $acl->{'destination'}->{'ipv4_addr'};
}
Expand All @@ -402,7 +405,9 @@ sub acl_chewer {
$src = "any";
} elsif($acl->{'source'}->{'ipv4_addr'} ne '0.0.0.0') {
if ($acl->{'source'}->{'wildcard'} ne '0.0.0.0') {
$src = $acl->{'source'}->{'ipv4_addr'}."/".norm_net_mask($acl->{'source'}->{'wildcard'});
my $net_addr = NetAddr::IP->new($acl->{'source'}->{'ipv4_addr'}, norm_net_mask($acl->{'source'}->{'wildcard'}));
my $cidr = $net_addr->cidr();
$src = $cidr;
} else {
$src = $acl->{'source'}->{'ipv4_addr'};
}
Expand Down

0 comments on commit 3ba9d73

Please sign in to comment.