link: Report errors obtaining recv buffer size on link overflow

This commit is contained in:
Roy Marples 2020-12-12 17:34:31 +00:00
parent 84fda07e2e
commit c81acbb4e5

View File

@ -1207,8 +1207,10 @@ dhcpcd_linkoverflow(struct dhcpcd_ctx *ctx)
socklen = sizeof(rcvbuflen);
if (getsockopt(ctx->link_fd, SOL_SOCKET,
SO_RCVBUF, &rcvbuflen, &socklen) == -1)
SO_RCVBUF, &rcvbuflen, &socklen) == -1) {
logerr("%s: getsockopt", __func__);
rcvbuflen = 0;
}
#ifdef __linux__
else
rcvbuflen /= 2;