Commit f47f5656 authored by Alessandro Rubini's avatar Alessandro Rubini

wrs-socket: retry getting a tx_timestamp on failure

Sometimes we get error in the recv(MSGQUEUE), with EAGAIN. Likely
we got a real frame (so poll for reading is ok) but no stamp yet.
This unsynced the transmitted frames and the error queue.

This fix, i.e. retry if getting nothing, seems to fix the (rare) problem.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 6cdecd8b
......@@ -375,7 +375,9 @@ static void poll_tx_timestamp(struct pp_instance *ppi, void *pkt, int len,
if (res != 1) {
pp_diag(ppi, time, 1, "%s: poll() = %i (%s)\n",
__func__, res, strerror(errno));
return;
if (retry++ > 5)
return;
continue;
}
res = recvmsg(fd, &msg, MSG_ERRQUEUE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment