Skip to content

Commit 48a1df4

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 ed6171f commit 48a1df4

4 files changed

Lines changed: 14 additions & 4 deletions

File tree

doc/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ All notable changes to the project are documented in this file.
1818
- Handle unclean daemon exits better, e.g., `dbus-daemon` crashing and
1919
leaving a stale pidfile behind, causing it to refuse to be restarted
2020
- Fix occasional blank or garbled `[ OK ]` lines at startup
21+
- Disallow multicast MAC addresses in custom MAC address configuration
2122

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

src/confd/yang/confd.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ MODULES=(
4747
"ieee802-ethernet-interface@2019-06-21.yang"
4848
"infix-ethernet-interface@2024-02-27.yang"
4949
"infix-factory-default@2023-06-28.yang"
50-
"infix-interfaces@2026-04-29.yang -e vlan-filtering"
50+
"infix-interfaces@2026-05-13.yang -e vlan-filtering"
5151
"ietf-crypto-types -e cleartext-symmetric-keys"
5252
"infix-crypto-types@2026-02-14.yang"
5353
"ietf-keystore -e symmetric-keys"

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)