netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] TIPC: Fix infinite loop in netlink handler
@ 2007-06-19 20:18 Florian Westphal
  2007-06-19 21:32 ` Patrick McHardy
  0 siblings, 1 reply; 4+ messages in thread
From: Florian Westphal @ 2007-06-19 20:18 UTC (permalink / raw)
  To: netdev; +Cc: jon.maloy, per.liden, tipc-discussion, allan.stephens

From: Florian Westphal <fw@strlen.de>

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>
---
 net/tipc/netlink.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/tipc/netlink.c b/net/tipc/netlink.c
index 4cdafa2..6a7f7b4 100644
--- a/net/tipc/netlink.c
+++ b/net/tipc/netlink.c
@@ -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;

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-06-20 16:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-19 20:18 [PATCH] TIPC: Fix infinite loop in netlink handler Florian Westphal
2007-06-19 21:32 ` Patrick McHardy
2007-06-20 14:13   ` Stephens, Allan
2007-06-20 16:12     ` Florian Westphal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).