Skip to content

Commit 1659ca2

Browse files
committed
Add migration script for confd: prevent IP addresses on bridge ports
Unfortunatly the fix was entered in 25.10, but confd was not stepped up until 25.11, so this should be for 25.10 but now it is for confd version 1.6 (infix 25.11), as close as we can get. this is a follwup for commit 7e37fc4 confd: prevent IP addresses on bridge ports Bridge ports should not have IP addresses configured. The IP address should be configured on the bridge interface itself, not its member ports. Add YANG must expression to enforce this rule at configuration time. Fixes #1122
1 parent 349a89b commit 1659ca2

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
# Remove ietf-ip:ipv4 and ietf-ip:ipv6 from bridge port interfaces.
3+
# Bridge ports should not have IP addresses; the IP address should
4+
# be configured on the bridge interface itself.
5+
file=$1
6+
temp=${file}.tmp
7+
8+
jq '
9+
if .["ietf-interfaces:interfaces"]?.interface then
10+
.["ietf-interfaces:interfaces"].interface |= map(
11+
if .["infix-interfaces:bridge-port"] and .type != "infix-if-type:bridge" then
12+
del(.["ietf-ip:ipv4"], .["ietf-ip:ipv6"])
13+
else
14+
.
15+
end
16+
)
17+
else
18+
.
19+
end
20+
' "$file" > "$temp" && mv "$temp" "$file"
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
migratedir = $(pkgdatadir)/migrate/1.6
22
dist_migrate_DATA = 10-dhcp-client-to-ipv4.sh \
33
20-autoconf-to-presence.sh \
4-
30-ospf-backbone-area-type.sh
4+
30-ospf-backbone-area-type.sh \
5+
40-bridge-port-remove-ip.sh

0 commit comments

Comments
 (0)