mirror of
https://github.com/rsmarples/dhcpcd.git
synced 2024-11-27 12:03:45 +08:00
Don't dispatch 0 bytes.
This commit is contained in:
parent
7ea9fe0f6a
commit
5c74cceb9b
7
if-bsd.c
7
if-bsd.c
@ -1530,15 +1530,16 @@ int
|
||||
if_handlelink(struct dhcpcd_ctx *ctx)
|
||||
{
|
||||
struct msghdr msg;
|
||||
ssize_t bytes;
|
||||
ssize_t len;
|
||||
|
||||
memset(&msg, 0, sizeof(msg));
|
||||
msg.msg_iov = ctx->iov;
|
||||
msg.msg_iovlen = 1;
|
||||
|
||||
if ((bytes = recvmsg_realloc(ctx->link_fd, &msg, 0)) == -1)
|
||||
if ((len = recvmsg_realloc(ctx->link_fd, &msg, 0)) == -1)
|
||||
return -1;
|
||||
if_dispatch(ctx, ctx->iov[0].iov_base);
|
||||
if (len != 0)
|
||||
if_dispatch(ctx, ctx->iov[0].iov_base);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
7
if-sun.c
7
if-sun.c
@ -770,15 +770,16 @@ int
|
||||
if_handlelink(struct dhcpcd_ctx *ctx)
|
||||
{
|
||||
struct msghdr msg;
|
||||
ssize_t bytes;
|
||||
ssize_t len;
|
||||
|
||||
memset(&msg, 0, sizeof(msg));
|
||||
msg.msg_iov = ctx->iov;
|
||||
msg.msg_iovlen = 1;
|
||||
|
||||
if ((bytes = recvmsg_realloc(ctx->link_fd, &msg, 0)) == -1)
|
||||
if ((len = recvmsg_realloc(ctx->link_fd, &msg, 0)) == -1)
|
||||
return -1;
|
||||
if_dispatch(ctx, ctx->iov[0].iov_base);
|
||||
if (len != 0)
|
||||
if_dispatch(ctx, ctx->iov[0].iov_base);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user