summaryrefslogtreecommitdiff
path: root/lib/zclient.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2025-01-27 20:26:32 +0100
committerDavid Lamparter <equinox@opensourcerouting.org>2025-01-28 15:40:17 +0100
commit2af780650fe8accddb9d07d037a823efd7c3d201 (patch)
tree2af1d253389d69f1465123964a96ce7e73e7d0d1 /lib/zclient.c
parent3671ce36fdcc1b74972d188250397da4e3b19f6d (diff)
lib, zebra: carry source prefix in route_notify
When a daemon wants to know about its routes, make it possible to have that work for dst-src routes. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/zclient.c')
-rw-r--r--lib/zclient.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/zclient.c b/lib/zclient.c
index 063944fd3b..d2bd7ed045 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -2016,6 +2016,15 @@ bool zapi_route_notify_decode(struct stream *s, struct prefix *p,
enum zapi_route_notify_owner *note,
afi_t *afi, safi_t *safi)
{
+ struct prefix dummy;
+
+ return zapi_route_notify_decode_srcdest(s, p, &dummy, tableid, note, afi, safi);
+}
+
+bool zapi_route_notify_decode_srcdest(struct stream *s, struct prefix *p, struct prefix *src_p,
+ uint32_t *tableid, enum zapi_route_notify_owner *note,
+ afi_t *afi, safi_t *safi)
+{
uint32_t t;
afi_t afi_val;
safi_t safi_val;
@@ -2025,6 +2034,9 @@ bool zapi_route_notify_decode(struct stream *s, struct prefix *p,
STREAM_GETC(s, p->family);
STREAM_GETC(s, p->prefixlen);
STREAM_GET(&p->u.prefix, s, prefix_blen(p));
+ src_p->family = p->family;
+ STREAM_GETC(s, src_p->prefixlen);
+ STREAM_GET(&src_p->u.prefix, s, prefix_blen(src_p));
STREAM_GETL(s, t);
STREAM_GETC(s, afi_val);
STREAM_GETC(s, safi_val);