[TIPC]: Fix infinite loop in netlink handler
authorFlorian Westphal <fw@strlen.de>
Sun, 24 Jun 2007 05:59:40 +0000 (22:59 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 24 Jun 2007 05:59:40 +0000 (22:59 -0700)
The tipc netlink config handler uses the nlmsg_pid from the
request header as destination for its reply. If the application
initialized nlmsg_pid to 0, the reply is looped back to the kernel,
causing hangup. Fix: use nlmsg_pid of the skb that triggered the
request.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/netlink.c

index 4cdafa2d1d4df66d3373b4de29e253720ccad6d6..6a7f7b4c2595b365ff5f3b015b23e553080baa8e 100644 (file)
@@ -60,7 +60,7 @@ static int handle_cmd(struct sk_buff *skb, struct genl_info *info)
                rep_nlh = nlmsg_hdr(rep_buf);
                memcpy(rep_nlh, req_nlh, hdr_space);
                rep_nlh->nlmsg_len = rep_buf->len;
-               genlmsg_unicast(rep_buf, req_nlh->nlmsg_pid);
+               genlmsg_unicast(rep_buf, NETLINK_CB(skb).pid);
        }
 
        return 0;