FRRouting / frr

The FRRouting Protocol Suite
https://frrouting.org/
Other
3.33k stars 1.25k forks source link

vtysh enters bfd peer configuration mode despite the validation error #7465

Closed idryzhov closed 3 years ago

idryzhov commented 3 years ago

Describe the bug

After executing an invalid command in bfd configuration mode, vtysh enters the peer configuration mode despite the error.

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

To Reproduce

nfware(config-bfd)# peer fe80::5054:ff:feb3:9bcd multihop
% Failed to edit configuration.

YANG error(s):
 Invalid value "(null)" in "source-addr" element.
 Invalid value "(null)" in "source-addr" element.
 YANG path: /frr-bfdd:source-addr
nfware(config-bfd-peer)#

Expected behavior

vtysh should not enter the peer configuration mode. bfdd doesn't enter this mode, so vtysh and bfdd become out of sync.

Screenshots

Versions

Additional context

The problem is that nb_cli_apply_changes (nb_cli_classic_commit) returns CMD_SUCCESS to vtysh, so it thinks that the command execution was successful. I'm not sure how to fix this properly, so I decided to file an issue.

rzalamena commented 3 years ago

You are correct, it shouldn't enter the node... Seems like something broke the return value of that function.

Maybe we should also improve the DEFUNs to also not allow having multihop and empty source.

idryzhov commented 3 years ago

@rzalamena I did git blame and it looks like the code was retuning CMD_SUCCESS since the beginning of transition to northbound model.