Skip to content

Commit b358525

Browse files
committed
confd: yang: Put some limits on custom mac addresses
Not correct MAC address for example multicast bit set, caused `ip` to exit with failure code, resulting in that configuration was not applied.
1 parent c66d11c commit b358525

4 files changed

Lines changed: 15 additions & 5 deletions

File tree

doc/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ All notable changes to the project are documented in this file.
1717
- Handle unclean daemon exits better, e.g., `dbus-daemon` crashing and
1818
leaving a stale pidfile behind, causing it to refuse to be restarted
1919
- Fix occasional blank or garbled `[ OK ]` lines at startup
20+
- Fix MAC address input validation in infix-interfaces YANG.
2021

2122
[v26.04.0][] - 2026-04-30
2223
-------------------------

src/confd/yang/confd/infix-if-bridge.yang

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -939,8 +939,8 @@ submodule infix-if-bridge {
939939
must "not(../ip:ipv4/ip:address or ../ip:ipv6/ip:address)" {
940940
error-message "Bridge ports cannot have IP addresses configured.";
941941
}
942-
must "not(derived-from-or-self(../if:type, 'infix-ift:wifi')) or ../infix-if:wifi/infix-if:access-point" {
943-
error-message "WiFi interfaces can only be bridge ports when configured as Access Points.";
942+
must "not(derived-from-or-self(../if:type, 'infix-ift:wifi')) or ../infix-if:wifi/infix-if:access-point or ../infix-if:wifi/infix-if:mesh-point" {
943+
error-message "WiFi interfaces can only be bridge ports when configured as Access Points or Mesh Points.";
944944
}
945945
description "Bridge association and port specific settings.";
946946
uses bridge-port-common;

src/confd/yang/confd/infix-interfaces.yang

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ module infix-interfaces {
4141
contact "kernelkit@googlegroups.com";
4242
description "Linux bridge and lag extensions for ietf-interfaces.";
4343

44+
revision 2026-05-13 {
45+
description "Add limitations on custom mac addresses on interfaces, now needs to be a correct unicast mac-address";
46+
reference "internal";
47+
}
48+
4449
revision 2026-04-29 {
4550
description "Add operational state for multicast router ports per bridge.";
4651
reference "internal";
@@ -235,8 +240,12 @@ module infix-interfaces {
235240

236241
case static {
237242
leaf static {
238-
description "Statically configured interface address on protocol sub-layer, e.g., MAC.";
239-
type yang:phys-address;
243+
description "Statically configured unicast MAC address.";
244+
type yang:mac-address {
245+
pattern '[0-9a-fA-F][02468aAcCeE]:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}' {
246+
error-message "Must be a unicast MAC address (multicast bit must not be set).";
247+
}
248+
}
240249
}
241250
}
242251

@@ -247,7 +256,7 @@ module infix-interfaces {
247256

248257
leaf offset {
249258
description "Static offset added to the chassis MAC address.";
250-
type yang:phys-address;
259+
type yang:mac-address;
251260
}
252261
}
253262
}
File renamed without changes.

0 commit comments

Comments
 (0)