Skip to content

Commit

Permalink
FRR IPv6 ACCEPTFILTER fix. Issue #12815
Browse files Browse the repository at this point in the history
  • Loading branch information
vktg committed Feb 17, 2022
1 parent 641248d commit a787a92
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion net/pfSense-pkg-frr/Makefile
Expand Up @@ -2,7 +2,7 @@

PORTNAME= pfSense-pkg-frr
PORTVERSION= 1.1.1
PORTREVISION= 4
PORTREVISION= 5
CATEGORIES= net
MASTER_SITES= # empty
DISTFILES= # empty
Expand Down
14 changes: 11 additions & 3 deletions net/pfSense-pkg-frr/files/usr/local/pkg/frr/inc/frr_zebra.inc
Expand Up @@ -699,6 +699,8 @@ function frr_zebra_generate_staticroutes() {
function frr_zebra_generate_acceptfilters() {
global $config, $frr_config_base;
$seq = 10;
$seq6 = 10;
$noaccept = '';

/* Check OSPF Interfaces for automatic accept filters */
if (is_array($config['installedpackages']['frrospfdinterfaces']['config'])) {
Expand All @@ -721,15 +723,21 @@ function frr_zebra_generate_acceptfilters() {
if (is_array($config['installedpackages']['frr']['config'][0]['row'])) {
foreach ($config['installedpackages']['frr']['config'][0]['row'] as $redistr) {
if (isset($redistr['acceptfilter'])) {
$noaccept = $noaccept ?: "";
$noaccept .= "ip prefix-list ACCEPTFILTER seq {$seq} deny {$redistr['routevalue']}\n";
$seq += 10;
if (is_subnetv4($redistr['routevalue'])) {
$noaccept .= "ip prefix-list ACCEPTFILTER seq {$seq} deny {$redistr['routevalue']}\n";
$seq += 10;
} else {
$noaccept .= "ipv6 prefix-list ACCEPTFILTER seq {$seq6} deny {$redistr['routevalue']}\n";
$seq6 += 10;
}
}
}
}
if (!empty($noaccept)) {
$noaccept .= "ip prefix-list ACCEPTFILTER seq {$seq} permit any\n";
$noaccept .= "!\n";
$noaccept .= "ipv6 prefix-list ACCEPTFILTER seq {$seq6} permit any\n";
$noaccept .= "!\n";
$noaccept .= "route-map ACCEPTFILTER permit 10\n";
$noaccept .= " match ip address prefix-list ACCEPTFILTER\n";
$noaccept .= "!\n";
Expand Down

0 comments on commit a787a92

Please sign in to comment.