summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-rtnl/rtnl-message.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-05-10 19:40:11 +0200
committerTom Gundersen <teg@jklm.no>2014-05-10 20:56:37 +0200
commit127dc4ea9487397b1ab70447e2f44d091e44ab5f (patch)
tree4e56036431d085a459ae883b7ae454fcba7bfa1c /src/libsystemd/sd-rtnl/rtnl-message.c
parent897e184c7d54156357fd204beafe06ab9bd0341a (diff)
rtnl: message - move code around
No functional change.
Diffstat (limited to 'src/libsystemd/sd-rtnl/rtnl-message.c')
-rw-r--r--src/libsystemd/sd-rtnl/rtnl-message.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libsystemd/sd-rtnl/rtnl-message.c b/src/libsystemd/sd-rtnl/rtnl-message.c
index d611207dea..fb429864b9 100644
--- a/src/libsystemd/sd-rtnl/rtnl-message.c
+++ b/src/libsystemd/sd-rtnl/rtnl-message.c
@@ -1154,10 +1154,6 @@ int socket_read_message(sd_rtnl *rtnl) {
else
len = (size_t)r;
- if (len > rtnl->rbuffer_allocated)
- /* message did not fit in read buffer */
- return -EIO;
-
for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) {
if (cmsg->cmsg_level == SOL_SOCKET &&
cmsg->cmsg_type == SCM_CREDENTIALS &&
@@ -1176,6 +1172,10 @@ int socket_read_message(sd_rtnl *rtnl) {
/* not from the kernel, ignore */
return 0;
+ if (len > rtnl->rbuffer_allocated)
+ /* message did not fit in read buffer */
+ return -EIO;
+
if (NLMSG_OK(rtnl->rbuffer, len) && rtnl->rbuffer->nlmsg_flags & NLM_F_MULTI) {
multi_part = true;