[NETLINK] : Use tgid instead of pid for nlmsg_pid
diff mbox series

Message ID E1EeJxb-0006xG-00@gondolin.me.apana.org.au
State New, archived
Headers show
Series
  • [NETLINK] : Use tgid instead of pid for nlmsg_pid
Related show

Commit Message

Herbert Xu Nov. 21, 2005, 10:16 p.m. UTC
Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> wrote:
> 
> I agree, apparently netlink_autobind was missed when sed'ing pid->tgid.
> Of course, it does not matter, but tgid is nicer choice from user's viewpoint.

Great, here is the patch to do just that.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Thanks,

Comments

David Miller Nov. 22, 2005, 10:43 p.m. UTC | #1
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Tue, 22 Nov 2005 09:16:27 +1100

> Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> wrote:
> > 
> > I agree, apparently netlink_autobind was missed when sed'ing pid->tgid.
> > Of course, it does not matter, but tgid is nicer choice from user's viewpoint.
> 
> Great, here is the patch to do just that.
> 
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Applied, of course.

I can't for the life of me figure out how we missed this when
we fixed up all the current->pid references under net/.
Ulrich Drepper let us know that the problem existed, and
I was sure we eliminated all such cases.

It is possible we accidently reintroduced current->pid when
we redid all of the netlink hashing. :-)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Herbert Xu Nov. 23, 2005, 12:03 a.m. UTC | #2
On Tue, Nov 22, 2005 at 02:43:34PM -0800, David S. Miller wrote:
> 
> Applied, of course.

Thanks Dave.
 
> It is possible we accidently reintroduced current->pid when
> we redid all of the netlink hashing. :-)

I just checked using git-whatchanged and that line goes back to
2002 :)

Cheers,
David Miller Nov. 23, 2005, 6:18 a.m. UTC | #3
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Wed, 23 Nov 2005 11:03:37 +1100

> On Tue, Nov 22, 2005 at 02:43:34PM -0800, David S. Miller wrote:
> > It is possible we accidently reintroduced current->pid when
> > we redid all of the netlink hashing. :-)
> 
> I just checked using git-whatchanged and that line goes back to
> 2002 :)

Ho hum, I guess we just missed it on the current->pid
scan then :-)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Patch
diff mbox series

diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -476,7 +476,7 @@  static int netlink_autobind(struct socke
 	struct hlist_head *head;
 	struct sock *osk;
 	struct hlist_node *node;
-	s32 pid = current->pid;
+	s32 pid = current->tgid;
 	int err;
 	static s32 rover = -4097;