libnetlink: __rtnl_talk_iov should only loop max iovlen times
William reported ip hanging and bisected to a recent commit for batching
allowing more than 1 command to be sent per message. The loop over
recvmsg should never cycle more than iovlen times -- 1 response for
each command in the message.
Fixes: 72a2ff3916 ("lib/libnetlink: Add a new function rtnl_talk_iov")
Signed-off-by: David Ahern <dsahern@gmail.com>
This commit is contained in:
parent
06867c3719
commit
3dec72672f
|
|
@ -670,8 +670,9 @@ next:
|
||||||
free(buf);
|
free(buf);
|
||||||
if (h->nlmsg_seq == seq)
|
if (h->nlmsg_seq == seq)
|
||||||
return 0;
|
return 0;
|
||||||
else
|
else if (i < iovlen)
|
||||||
goto next;
|
goto next;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rtnl->proto != NETLINK_SOCK_DIAG &&
|
if (rtnl->proto != NETLINK_SOCK_DIAG &&
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue