X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;ds=sidebyside;f=src%2Flibsystemd%2Fsd-rtnl%2Frtnl-message.c;h=30e33584c4ac649cac0a833707b62dad00d6825e;hb=cedc611207b6a14cdbaf1d73e12b62ee55cc53de;hp=1f596ca10cdc6cf80f7d409bd7ca1c5c7fad0ba1;hpb=ee8c45689526ca973407cbb77bce7b96a062c40b;p=elogind.git diff --git a/src/libsystemd/sd-rtnl/rtnl-message.c b/src/libsystemd/sd-rtnl/rtnl-message.c index 1f596ca10..30e33584c 100644 --- a/src/libsystemd/sd-rtnl/rtnl-message.c +++ b/src/libsystemd/sd-rtnl/rtnl-message.c @@ -531,7 +531,6 @@ static int add_rtattr(sd_rtnl_message *m, unsigned short type, const void *data, /* if no data was passed, make sure we still initialize the padding note that we can have data_length > 0 (used by some containers) */ padding = RTA_DATA(rta); - data_length = 0; } /* make sure also the padding at the end of the message is initialized */ @@ -1132,10 +1131,13 @@ static int socket_recv_message(int fd, struct iovec *iov, uint32_t *_group, bool assert(iov); r = recvmsg(fd, &msg, MSG_TRUNC | (peek ? MSG_PEEK : 0)); - if (r < 0) + if (r < 0) { /* no data */ + if (errno == ENOBUFS) + log_debug("rtnl: kernel receive buffer overrun"); + return (errno == EAGAIN) ? 0 : -errno; - else if (r == 0) + } else if (r == 0) /* connection was closed by the kernel */ return -ECONNRESET;