diff options
author | Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp> | 2009-04-07 14:02:24 +0900 |
---|---|---|
committer | Dhaval Giani <dhaval@linux.vnet.ibm.com> | 2009-04-13 16:52:53 +0530 |
commit | e9b0b26d8bf46719b05e8ebf7bccb829ba1cec93 (patch) | |
tree | b2c138b5e3350c58626cd44647af4f0bba342cdd | |
parent | 52ee80ca0f26e4a7350504c56fb17decb562420b (diff) | |
download | libcg-e9b0b26d8bf46719b05e8ebf7bccb829ba1cec93.tar.gz libcg-e9b0b26d8bf46719b05e8ebf7bccb829ba1cec93.tar.xz libcg-e9b0b26d8bf46719b05e8ebf7bccb829ba1cec93.zip |
Fix infinite loop if receiving a NLMSG_NOOP packet.
Hi,
I tested 'cgred' service and I saw the problem that some processes
are not moved to a right cgroup. This problem did not occur always,
and it did sometimes. I reviewed cgrulesengd.c and found the bug
cgrulesengd stays in an infinite loop if receiving a NLMSG_NOOP
packet.
This patch fixes this problem.
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
-rw-r--r-- | src/daemon/cgrulesengd.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/daemon/cgrulesengd.c b/src/daemon/cgrulesengd.c index 8efdce1..4e00e18 100644 --- a/src/daemon/cgrulesengd.c +++ b/src/daemon/cgrulesengd.c @@ -386,8 +386,10 @@ int cgre_create_netlink_socket_process_msg() continue; while (NLMSG_OK(nlh, recv_len)) { cn_hdr = NLMSG_DATA(nlh); - if (nlh->nlmsg_type == NLMSG_NOOP) + if (nlh->nlmsg_type == NLMSG_NOOP) { + nlh = NLMSG_NEXT(nlh, recv_len); continue; + } if ((nlh->nlmsg_type == NLMSG_ERROR) || (nlh->nlmsg_type == NLMSG_OVERRUN)) break; |