diff options
author | Nicolas Dichtel <nicolas.dichtel@6wind.com> | 2015-09-16 09:42:36 +0200 |
---|---|---|
committer | Paul Jakma <paul@quagga.net> | 2015-09-24 15:26:41 +0100 |
commit | 794c4735f81289d9fc603b5fd5e4a5d39dbb5ca5 (patch) | |
tree | b81f6a549fe0916bdf25b5a5a88745c34a4e816d /lib/zclient.h | |
parent | a29c8a23a35b3f94c6aea5b3b7578b5dbf81ad71 (diff) | |
download | quagga-794c4735f81289d9fc603b5fd5e4a5d39dbb5ca5.tar.bz2 quagga-794c4735f81289d9fc603b5fd5e4a5d39dbb5ca5.tar.xz |
bgpd/pimd: fix zAPI parsing
Commit c99f3481a598 has changed the API. Now, the vrfid has been added in
the header, thus we must read it before parsing the rest of the message.
To ease code maintenance, let's add a new function to read a zAPI header.
Fixes: c99f3481a598 ("*: add VRF ID in the API message header")
Reported-by: Martin Winter <mwinter@opensourcerouting.org>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
Tested-by: Martin Winter <mwinter@opensourcerouting.org>
Diffstat (limited to 'lib/zclient.h')
-rw-r--r-- | lib/zclient.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/zclient.h b/lib/zclient.h index 19b4f0ea..3490b320 100644 --- a/lib/zclient.h +++ b/lib/zclient.h @@ -163,6 +163,9 @@ extern int zclient_send_message(struct zclient *); /* create header for command, length to be filled in by user later */ extern void zclient_create_header (struct stream *, uint16_t, vrf_id_t); +extern int zclient_read_header (struct stream *s, int sock, u_int16_t *size, + u_char *marker, u_char *version, + u_int16_t *vrf_id, u_int16_t *cmd); extern struct interface *zebra_interface_add_read (struct stream *, vrf_id_t); |