From e9b0b26d8bf46719b05e8ebf7bccb829ba1cec93 Mon Sep 17 00:00:00 2001 From: Ken'ichi Ohmichi Date: Tue, 7 Apr 2009 14:02:24 +0900 Subject: 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 Acked-by: Balbir Singh Signed-off-by: Dhaval Giani --- src/daemon/cgrulesengd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- cgit