diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2015-09-17 10:54:25 -0400 |
---|---|---|
committer | Paul Jakma <paul@quagga.net> | 2015-09-24 15:26:44 +0100 |
commit | a9d4cb33faa6af622240190a80f41c4672374925 (patch) | |
tree | 9590bb1715d7418b50a742a3c83363d4e4b67755 /bgpd | |
parent | f733280419f18b1a0e3b06ec3681781689d57053 (diff) | |
download | quagga-a9d4cb33faa6af622240190a80f41c4672374925.tar.bz2 quagga-a9d4cb33faa6af622240190a80f41c4672374925.tar.xz |
lib/zclient: Consolidate error reporting for zclient_read_header
All functions that call zclient_read_header immediately turn around
and check to ensure that the version and marker fields are correct
Move this code into zclient_read_header
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'bgpd')
-rw-r--r-- | bgpd/bgp_nexthop.c | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c index c74bebad..20302e39 100644 --- a/bgpd/bgp_nexthop.c +++ b/bgpd/bgp_nexthop.c @@ -809,13 +809,7 @@ zlookup_read (void) zlog_err("%s: zserv_read_header() failed", __func__); return NULL; } - if (version != ZSERV_VERSION || marker != ZEBRA_HEADER_MARKER) - { - zlog_err("%s: socket %d version mismatch, marker %d, version %d", - __func__, zlookup->sock, marker, version); - return NULL; - } - + /* XXX: not doing anything with raddr */ raddr.s_addr = stream_get_ipv4 (s); metric = stream_getl (s); @@ -918,13 +912,7 @@ zlookup_read_ipv6 (void) zlog_err("%s: zserv_read_header() failed", __func__); return NULL; } - if (version != ZSERV_VERSION || marker != ZEBRA_HEADER_MARKER) - { - zlog_err("%s: socket %d version mismatch, marker %d, version %d", - __func__, zlookup->sock, marker, version); - return NULL; - } - + /* XXX: not actually doing anything with raddr */ stream_get (&raddr, s, 16); @@ -1065,13 +1053,7 @@ bgp_import_check (struct prefix *p, u_int32_t *igpmetric, zlog_err("%s: zserv_read_header() failed", __func__); return 0; } - if (version != ZSERV_VERSION || marker != ZEBRA_HEADER_MARKER) - { - zlog_err("%s: socket %d version mismatch, marker %d, version %d", - __func__, zlookup->sock, marker, version); - return 0; - } - + /* XXX: not using addr */ addr.s_addr = stream_get_ipv4 (s); metric = stream_getl (s); |