mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 03:27:25 +00:00
zebra: fix label manager EAGAIN error
when receiving an EAGAIN while trying to read the header of a ZAPI message, we were erroneously continuing as if everything was fine, which could crash zebra. Fix this by returning and letting the re-armed read task deal with this Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
This commit is contained in:
parent
ea63ff6bbd
commit
614a0f8613
@ -75,6 +75,10 @@ static int relay_response_back(void)
|
||||
unsigned short instance;
|
||||
struct zserv *zserv;
|
||||
|
||||
/* sanity */
|
||||
if (!zclient || zclient->sock < 0)
|
||||
return -1;
|
||||
|
||||
/* input buffer with msg from label manager */
|
||||
src = zclient->ibuf;
|
||||
|
||||
@ -83,10 +87,11 @@ static int relay_response_back(void)
|
||||
/* parse header */
|
||||
ret = zclient_read_header(src, zclient->sock, &size, &marker, &version,
|
||||
&vrf_id, &resp_cmd);
|
||||
if (ret < 0 && errno != EAGAIN) {
|
||||
flog_err(EC_ZEBRA_LM_RESPONSE,
|
||||
"Error reading Label Manager response: %s",
|
||||
strerror(errno));
|
||||
if (ret < 0) {
|
||||
if (errno != EAGAIN)
|
||||
flog_err(EC_ZEBRA_LM_RESPONSE,
|
||||
"Error reading Label Manager response: %s",
|
||||
strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user