Skip to content

Conversation

@hedrok
Copy link
Contributor

@hedrok hedrok commented Dec 27, 2025

Make frr-reload use 'no interface' only for deleted interfaces, for active interfaces don't run 'no interface', run 'no' for all commands in interface section.

This was the behavior before #16723, which was a fix for case when interface was deleted from system: in this case inner commands with 'no' failed, and 'no interface' works.

But if interface is still active and whole configuration for the interface is deleted FRR issues error 'Failed to create cfgdata: only inactive interfaces can be deleted', so in this case it is proper to run 'no' version of all commands in section, but not 'no interface'.

How to test:

sudo ip link add dum771 type dummy
sudo ip link add dum881 type dummy

cat > frr-clean.conf << EOF
frr version 10.6-dev
frr defaults traditional
hostname r1
log syslog notifications
log timestamp precision 3
no log unique-id
service integrated-vtysh-config
!
EOF

cat > frr-with-interfaces.conf << EOF
frr version 10.6-dev
frr defaults traditional
hostname r1
log syslog notifications
log timestamp precision 3
no log unique-id
service integrated-vtysh-config
!
interface dum771
 ip address 10.77.0.1/24
exit
!
interface dum881
 ip address 10.88.0.1/24
exit
!
EOF
sudo /usr/lib/frr/frr-reload.py --reload frr-with-interfaces.conf

sudo ip link delete dum771

# Now `vtysh -c 'configure' -c 'no interface dum881'` results in error (current behaviour of frr-reload):

#% Configuration failed.
#
#commit failed session-id 1119 on Unknown-FD-16 req-id 3 source-ds: candidate target-ds: running validate-only: 0: reason: 'Failed to create cfgdata: only inactive interfaces can be deleted'

# I couldn't reproduce error in case of per-line 'no' deletion of parameters for dum881 (behaviour before PR #16723), but I didn't test GRE tunnels

# So after changes in this PR
sudo /usr/lib/frr/frr-reload.py --test frr-clean.conf

# gives:
# > Lines To Delete
# > ===============
# > no interface dum771
# > interface dum881
# >  no ip address 10.88.0.1/24
# > exit

# And can be applied cleanly:
sudo /usr/lib/frr/frr-reload.py --reload frr-clean.conf

Make frr-reload use 'no interface' only for deleted interfaces, for
active interfaces don't run 'no interface', run 'no' for all commands in
interface section.

This was the behavior before f1a1703,
which was a fix for case when interface was deleted from system: in this
case inner commands with 'no' failed, and 'no interface' works.

But if interface is still active and whole configuration for the
interface is deleted FRR issues error 'Failed to create cfgdata: only
inactive interfaces can be deleted', so in this case it is proper to run
'no' version of all commands in section, but not 'no interface'.

Signed-off-by: Kyrylo Yatsenko <hedrok@gmail.com>
@hedrok hedrok force-pushed the fix-frr-reload-deleting-active-interface branch from d6b9517 to 6270c2c Compare December 27, 2025 17:37
@hedrok hedrok marked this pull request as draft December 27, 2025 21:25
@hedrok
Copy link
Contributor Author

hedrok commented Jan 6, 2026

During meeting it was decided not to add dependencies on system state in frr-reload.py

@hedrok hedrok closed this Jan 6, 2026
@hedrok hedrok deleted the fix-frr-reload-deleting-active-interface branch January 6, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant