From 764a64bee8bcd44040bc909a0e2ef640dc40b1cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= Date: Mon, 26 Aug 2024 15:02:04 +0200 Subject: [PATCH] yang: Improve must expressions for multicast-filters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a must expression to limit invalid configurations. Not belonging to VLAN when added to a multicast-filter in that VLAN. Make sure multicast snooping is enabled when using multicast filters. This fixes #587 Signed-off-by: Mattias Walström --- ...8.yang => infix-if-bridge@2024-08-26.yang} | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) rename src/confd/yang/{infix-if-bridge@2024-03-28.yang => infix-if-bridge@2024-08-26.yang} (92%) diff --git a/src/confd/yang/infix-if-bridge@2024-03-28.yang b/src/confd/yang/infix-if-bridge@2024-08-26.yang similarity index 92% rename from src/confd/yang/infix-if-bridge@2024-03-28.yang rename to src/confd/yang/infix-if-bridge@2024-08-26.yang index 4d64748c..74806d3f 100644 --- a/src/confd/yang/infix-if-bridge@2024-03-28.yang +++ b/src/confd/yang/infix-if-bridge@2024-08-26.yang @@ -32,6 +32,15 @@ submodule infix-if-bridge { contact "kernelkit@googlegroups.com"; description "Linux bridge extension for ietf-interfaces."; + revision 2024-08-26 { + description "Improve must expressions for multicast. + + Add a must expression forcing a port in a dot1q multicast-filter + to also belong to the VLAN. Also add must expression (for both + 8021d and 8021q) to force snooping to be anabled when enable + multicast-filters"; + reference "internal"; + } revision 2024-03-28 { description "Rename mdb -> multicast-filters. @@ -386,6 +395,13 @@ submodule infix-if-bridge { } } } + deviation "/if:interfaces/if:interface/infix-if:bridge/type/ieee8021d/multicast-filters/multicast-filter" { + deviate add { + must "../../multicast/snooping = 'true'" { + error-message "Multicast snooping is required when configure multicast-filters "; + } + } + } deviation "/if:interfaces/if:interface/infix-if:bridge/type/ieee8021q/vlans/vlan/multicast-filters/multicast-filter/ports/port" { deviate add { @@ -395,6 +411,20 @@ submodule infix-if-bridge { } } } + deviation "/if:interfaces/if:interface/infix-if:bridge/type/ieee8021q/vlans/vlan/multicast-filters/multicast-filter/ports/port" { + deviate add { + must "(../../../../untagged[contains(., current())]) or (../../../../tagged[contains(., current())])" { + error-message "Port is not member of of VLAN"; + } + } + } + deviation "/if:interfaces/if:interface/infix-if:bridge/type/ieee8021q/vlans/vlan/multicast-filters/multicast-filter" { + deviate add { + must "../../multicast/snooping = 'true'" { + error-message "Multicast snooping is required when configure multicast-filters "; + } + } + } deviation "/if:interfaces/if:interface/ip:ipv4/ip:enabled" { deviate add {