Skip to content

Commit

Permalink
Merge pull request #736 from socallinuxexpo/od_21x_patch07
Browse files Browse the repository at this point in the history
[READY] Fixed filter and other errors
  • Loading branch information
kylerisse authored Mar 16, 2024
2 parents c102454 + 68f4d8c commit ba5d365
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}
else
{
$switchlist = get_switchlist();
$switchlist = get_switchlist(1);
}
my @outputs = ();
my @maps = ();
Expand Down
8 changes: 5 additions & 3 deletions switch-configuration/config/scripts/switch_config_loader
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
#
# -u <username> -- username to provide to swtiches for authentication
#
# -z -- Go ahead and process switches in the Z (unused) hierarchy
#
# <switch_spec> -- One or more switch names and/or groups
# Cannot be used with -l or any of the options that imply -l
# unless it resolves to a single switch.
Expand Down Expand Up @@ -103,7 +105,8 @@ our $opt_n;
our $opt_p;
our $opt_t;
our $opt_u;
getopts('bc:hklnpt:u:');
our $opt_z;
getopts('bc:hklnpt:u:z');

# Check for implicit or incompatible arguments.
if ($opt_h)
Expand Down Expand Up @@ -133,7 +136,7 @@ if ($opt_c && $opt_l && scalar(@list) == 0)

if (scalar(@list) == 0)
{
@list = @{Loader::get_switchlist()};
@list = @{Loader::get_switchlist($opt_z)};
print "Pulled ", scalar(@list), " switches from configuration list\n";
}
else
Expand All @@ -145,7 +148,6 @@ else

print "List expansion yielded ", scalar(@list), " Switch names.\n";


if ($opt_t && (scalar(@list) != 1))
{
warn("Use of -t requires exactly one switch be specified.\n");
Expand Down
22 changes: 16 additions & 6 deletions switch-configuration/config/scripts/switch_template.pm
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,20 @@ sub read_config_file

sub get_switchlist
{
my @list = sort(keys(%Switchtypes));
my $include_Z = shift(@_);
my @list=();
foreach(sort(keys(%Switchtypes)))
{
if ($include_Z || $Switchtypes{$_}[4] ne "Z")
{
push @list, $_;
debug(9, "Adding $_ to list with group $Switchtypes{$_}[4]\n");
}
else
{
debug(9, "Skipping $_ with group $Switchtypes{$_}[4]\n");
}
}
debug(5, "get_switchlist called\n");
if (scalar(@list))
{
Expand Down Expand Up @@ -1058,7 +1071,7 @@ sub VV_init_firewall
destination-address {
2001:470:f026::/48
}
icmp-type [ neighbor-solicit neighbor-advertise router-solicit packet-too-big time-exceeded ];
icmp-type [ neighbor-solicit neighbor-advertisement router-solicit packet-too-big time-exceeded ];
}
then {
accept;
Expand Down Expand Up @@ -1112,10 +1125,7 @@ sub VV_init_firewall
filter only_from_internet6 {
term ipv6_icmp_basics {
from {
destination-address {
2001:470:f026::/48
}
icmp-type [ neighbor-solicit neighbor-advertise router-advertise packet-too-big time-exceeded ];
icmp-type [ neighbor-solicit neighbor-advertisement router-advertisement packet-too-big time-exceeded ];
}
then {
accept;
Expand Down

0 comments on commit ba5d365

Please sign in to comment.