Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ospfd: OSPF SR is not turned on - "segment-routing node-msd" always enabled by default #14910

Closed
1 of 2 tasks
c-po opened this issue Nov 29, 2023 · 3 comments · Fixed by #15333
Closed
1 of 2 tasks

ospfd: OSPF SR is not turned on - "segment-routing node-msd" always enabled by default #14910

c-po opened this issue Nov 29, 2023 · 3 comments · Fixed by #15333
Assignees
Labels

Comments

@c-po
Copy link
Contributor

c-po commented Nov 29, 2023

Describe the bug

frr-reload.py fails as OSPF process always installs a segment-routing config line segment-routing node-msd 5

  • Did you check if this is a duplicate issue?
  • Did you test it on the latest FRRouting/frr master branch?

To Reproduce

** With vtysh **

cpo@LR1.wue3:~$ vtysh -c "show run" -d ospfd
Building configuration...

Current configuration:
!
frr version 9.1
frr defaults traditional
hostname LR1.wue3
log syslog
log facility local7
service integrated-vtysh-config
!
end

Now start OSPF

cpo@LR1.wue3:~$ vtysh -c "conf" -c "router ospf" -d ospfd
cpo@LR1.wue3:~$ vtysh -c "show run" -d ospfd
...
!
router ospf
 segment-routing node-msd 5
exit
!
end

This behavior manifests in un-reloadable configurations using frr-reload:

cpo@LR1.wue3:~$ cat no-ospf.txt
!
end

Unloading config works: /usr/lib/frr/frr-reload.py --reload --daemon ospfd --debug --stdout no-ospf.txt

Now start OSPF process using frr-reload:

cpo@LR1.wue3:~$ cat ospf.txt
!
router ospf
 log-adjacency-changes detail
exit
!
end

sudo /usr/lib/frr/frr-reload.py --reload --daemon ospfd --stdout ospf.txt

The first run is successful and you get:

cpo@LR1.wue3:~$ vtysh -c "show run" -d ospfd
...
!
router ospf
 log-adjacency-changes detail
 segment-routing node-msd 5
exit
!

Any subsequent run will result in:

cpo@LR1.wue3:~$ sudo /usr/lib/frr/frr-reload.py --reload --daemon ospfd --debug  --stdout ospf.txt
2023-11-29 20:34:01,853  INFO: Called via "Namespace(input=None, reload=True, test=False, debug=True, log_level='info', stdout=True, pathspace=None, filename='ospf.txt', overwrite=False, bindir='/usr/bin', confdir='/etc/frr', rundir='/var/run/frr', vty_socket=None, daemon='ospfd', test_reset=False)"
2023-11-29 20:34:01,853  INFO: Loading Config object from file ospf.txt
2023-11-29 20:34:01,889 DEBUG: LINE router ospf                                       : enter context ['router ospf']
2023-11-29 20:34:01,889 DEBUG: LINE log-adjacency-changes detail                      : add to current context ['router ospf']
2023-11-29 20:34:01,890 DEBUG: LINE exit                                              : exit context ['router ospf']
2023-11-29 20:34:01,929 DEBUG: New Frr Config
!
router ospf
log-adjacency-changes detail
exit
!

end

2023-11-29 20:34:01,929  INFO: Loading Config object from vtysh show running
2023-11-29 20:34:01,968 DEBUG: LINE frr version 9.1                                   : single-line context
2023-11-29 20:34:01,968 DEBUG: LINE frr defaults traditional                          : single-line context
2023-11-29 20:34:01,968 DEBUG: LINE hostname LR1.wue3                                 : single-line context
2023-11-29 20:34:01,969 DEBUG: LINE service integrated-vtysh-config                   : single-line context
2023-11-29 20:34:01,969 DEBUG: LINE router ospf                                       : enter context ['router ospf']
2023-11-29 20:34:01,969 DEBUG: LINE log-adjacency-changes detail                      : add to current context ['router ospf']
2023-11-29 20:34:01,969 DEBUG: LINE segment-routing node-msd 5                        : add to current context ['router ospf']
2023-11-29 20:34:01,969 DEBUG: LINE exit                                              : exit context ['router ospf']
2023-11-29 20:34:01,969 DEBUG: Running Frr Config (Pass #0)
frr version 9.1
frr defaults traditional
hostname LR1.wue3
service integrated-vtysh-config
!
router ospf
log-adjacency-changes detail
segment-routing node-msd 5
exit
!
end
2023-11-29 20:34:01,969  INFO: "frr version 9.1" cannot be removed
2023-11-29 20:34:01,969  INFO: "frr defaults traditional" cannot be removed
2023-11-29 20:34:01,969  INFO: "service integrated-vtysh-config" cannot be removed
2023-11-29 20:34:02,007  INFO: Executed "no hostname LR1.wue3"
2023-11-29 20:34:02,046  INFO: Failed to execute router ospf  no segment-routing node-msd 5 exit
2023-11-29 20:34:02,046   ERROR: "router ospf --  no segment-routing node-msd 5 -- exit" we failed to remove this command
2023-11-29 20:34:02,046   ERROR: % OSPF SR is not turned on

2023-11-29 20:34:02,046  INFO: Loading Config object from vtysh show running
2023-11-29 20:34:02,085 DEBUG: LINE frr version 9.1                                   : single-line context
2023-11-29 20:34:02,085 DEBUG: LINE frr defaults traditional                          : single-line context
2023-11-29 20:34:02,086 DEBUG: LINE hostname LR1.wue3                                 : single-line context
2023-11-29 20:34:02,086 DEBUG: LINE service integrated-vtysh-config                   : single-line context
2023-11-29 20:34:02,086 DEBUG: LINE router ospf                                       : enter context ['router ospf']
2023-11-29 20:34:02,086 DEBUG: LINE log-adjacency-changes detail                      : add to current context ['router ospf']
2023-11-29 20:34:02,086 DEBUG: LINE segment-routing node-msd 5                        : add to current context ['router ospf']
2023-11-29 20:34:02,086 DEBUG: LINE exit                                              : exit context ['router ospf']
2023-11-29 20:34:02,086 DEBUG: Running Frr Config (Pass #1)
frr version 9.1
frr defaults traditional
hostname LR1.wue3
service integrated-vtysh-config
!
router ospf
log-adjacency-changes detail
segment-routing node-msd 5
exit
!
end
2023-11-29 20:34:02,086  INFO: "frr version 9.1" cannot be removed
2023-11-29 20:34:02,086  INFO: "frr defaults traditional" cannot be removed
2023-11-29 20:34:02,086  INFO: "service integrated-vtysh-config" cannot be removed

Expected behavior

Reload completes

Screenshots

Versions

  • OS Version: Debian 12
  • Kernel: 6.1.64

Additional context

@c-po c-po added the triage Needs further investigation label Nov 29, 2023
@odd22 odd22 added ospf and removed triage Needs further investigation labels Dec 19, 2023
@odd22 odd22 self-assigned this Dec 19, 2023
@odd22
Copy link
Member

odd22 commented Dec 19, 2023

Hi,

I'm seeing what's wrong. Default value should not be written if Segment Routing is disabled. I'll have a look to correct the problem.

Olivier

@c-po
Copy link
Contributor Author

c-po commented Jan 14, 2024

@odd22 anything we can help you with?

@c-po c-po changed the title ospfd: OSPF SR is not turned on - "segment-routing node-msd 5" always enabled by default ospfd: OSPF SR is not turned on - "segment-routing node-msd" always enabled by default Feb 8, 2024
@c-po
Copy link
Contributor Author

c-po commented Feb 8, 2024

Can also be reproduced within vtysh:

Enable SR and MSD

LR1.wue3(config-router)# router ospf
 segment-routing on
 segment-routing node-msd 5

Disable SR

LR1.wue3(config-router)# router ospf
 no segment-routing on

MSD can no longer be removed

LR1.wue3(config-router)# no segment-routing node-msd 5
% OSPF SR is not turned on

Even removing the entire OSPF process does not help

LR1.wue3(config)# no router ospf
LR1.wue3(config)# router ospf
LR1.wue3(config-router)# end
router ospf
 segment-routing node-msd 5
exit

Assumption

In ospf_sr_stop the value of OspfSR.msd should be set back to 0 as in ospf_sr_init

c-po added a commit to c-po/frr that referenced this issue Feb 8, 2024
This fixes the initial implementation of commit 7743f2f ("OSPFd: Update
Segment Routing PR following review") where it wsa not possible to remove
the "segment-routing node-msd" CLI nodes via vtysh once segment-routing got
disabled.

Closes FRRouting#14910

Signed-off-by: Christian Breunig <christian@breunig.cc>
c-po added a commit to c-po/frr that referenced this issue Feb 8, 2024
This fixes the initial implementation of commit 7743f2f ("OSPFd: Update
Segment Routing PR following review") where it wsa not possible to remove
the "segment-routing node-msd" CLI nodes via vtysh once segment-routing got
disabled.

Closes FRRouting#14910
mergify bot pushed a commit that referenced this issue Feb 9, 2024
This fixes the initial implementation of commit 7743f2f ("OSPFd: Update
Segment Routing PR following review") where it wsa not possible to remove
the "segment-routing node-msd" CLI nodes via vtysh once segment-routing got
disabled.

Closes #14910

Signed-off-by: Christian Breunig <christian@breunig.cc>
(cherry picked from commit ba45aa6)
mergify bot pushed a commit that referenced this issue Feb 9, 2024
This fixes the initial implementation of commit 7743f2f ("OSPFd: Update
Segment Routing PR following review") where it wsa not possible to remove
the "segment-routing node-msd" CLI nodes via vtysh once segment-routing got
disabled.

Closes #14910

Signed-off-by: Christian Breunig <christian@breunig.cc>
(cherry picked from commit ba45aa6)
c-po added a commit to c-po/frr that referenced this issue Feb 9, 2024
This fixes the initial implementation of commit 7743f2f ("OSPFd: Update
Segment Routing PR following review") where it wsa not possible to remove
the "segment-routing node-msd" CLI nodes via vtysh once segment-routing got
disabled.

Closes FRRouting#14910

Signed-off-by: Christian Breunig <christian@breunig.cc>
(cherry picked from commit ba45aa6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants