From 8e95b6ed461fc4dca2e2dbfeac4c2139013055b7 Mon Sep 17 00:00:00 2001 From: Monviech <79600909+Monviech@users.noreply.github.com> Date: Thu, 13 Mar 2025 19:33:00 +0100 Subject: [PATCH] net/frr: Fix passive interface generation in ospf (#4594) --- net/frr/Makefile | 1 + .../service/templates/OPNsense/Quagga/ospfd.conf | 13 +++++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/net/frr/Makefile b/net/frr/Makefile index 46155e8a8..c7cbc732c 100644 --- a/net/frr/Makefile +++ b/net/frr/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= frr PLUGIN_VERSION= 1.43 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= The FRRouting Protocol Suite PLUGIN_DEPENDS= frr8-pythontools PLUGIN_MAINTAINER= ad@opnsense.org diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospfd.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospfd.conf index b937c735b..b6da96c22 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospfd.conf +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospfd.conf @@ -9,20 +9,17 @@ agentx {% endif %} {% endif %} -{% set passive_interfaces = [] %} -{% if helpers.exists('OPNsense.quagga.ospf.passiveinterfaces') and OPNsense.quagga.ospf.passiveinterfaces != '' %} -{% for line in OPNsense.quagga.ospf.passiveinterfaces.split(',') %} -{% set iface = physical_interface(line) %} -{% set _ = passive_interfaces.append(iface) %} -interface {{ iface }} +{% if OPNsense.quagga.ospf.passiveinterfaces %} +{% for iface in OPNsense.quagga.ospf.passiveinterfaces.split(',') %} +interface {{ helpers.physical_interface(iface) }} ip ospf passive {% endfor %} {% endif %} -{# Render only the enabled non-passive interfaces past this point #} +{# vtysh automatically merges passive interfaces with interfaces below #} {% if helpers.exists('OPNsense.quagga.ospf.interfaces.interface') %} {% for interface in helpers.toList('OPNsense.quagga.ospf.interfaces.interface') %} {% set iface = physical_interface(interface.interfacename) %} -{% if interface.enabled == '1' and iface not in passive_interfaces %} +{% if interface.enabled == '1' %} interface {{ iface }} {% if interface.bfd|default('') == '1' %} ip ospf bfd