]> git.puffer.fish Git - mirror/frr.git/commit
lib, mgmtd: fix processing of yang notifications
authorIgor Ryzhov <iryzhov@nfware.com>
Fri, 9 Feb 2024 22:58:49 +0000 (00:58 +0200)
committerIgor Ryzhov <iryzhov@nfware.com>
Fri, 9 Feb 2024 23:00:24 +0000 (01:00 +0200)
commitd94f80fbc4347cbbf5ee6ecbdf3682329db832dc
treedab7de197df1ae57c726701d24e8eaeb918a2a00
parent75d3e4336855c2631f0a7bbecb1548ef8a7a9fb7
lib, mgmtd: fix processing of yang notifications

Current code assumes that notification is always sent in stripped JSON
format and therefore notification xpath starts at the third symbol of
notification data. Assuming JSON is more or less fine, because this
representation is internal to FRR, but the assumption about the xpath is
wrong, because it won't work for not top-level notifications. YANG
allows to define notification as a child for some data node deep into
the tree and in this case notification data contains not only the
notification node itself, but also all its parents.

To fix the issue, parse the notification data and get its xpath from its
schema node.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
lib/mgmt_be_client.c
lib/yang.c
lib/yang.h
mgmtd/mgmt_be_adapter.c
mgmtd/mgmt_testc.c
tests/topotests/mgmt_notif/test_notif.py