rtnl: message - move code around

No functional change.
This commit is contained in:
Tom Gundersen 2014-05-10 19:40:11 +02:00
parent 897e184c7d
commit 127dc4ea94

View file

@ -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;