]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] Re: unix_getname buglet - > 2.5.4(?)
authorRay Lee <ray-lk@madrabbit.org>
Tue, 7 Jan 2003 02:40:52 +0000 (18:40 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Tue, 7 Jan 2003 02:40:52 +0000 (18:40 -0800)
Micheal Meeks notes:

"Evolution is non-functioning on recent 2.5.X kernels, due to
    mal-performance in getpeername => net/unix/af_unix.c (unix_getname),
    where it seems we switch 'sk' on 'peer', but not the (previously)
    typecast pointer to it; this fixes it."

Whitespace fixes by Ray Lee.

net/unix/af_unix.c

index 60212c864efa89b42313629882ac3c360f742ed7..4bf58bcd7723c82a8533c0a95d2807d1f9b4f705 100644 (file)
@@ -1109,7 +1109,7 @@ out:
 static int unix_getname(struct socket *sock, struct sockaddr *uaddr, int *uaddr_len, int peer)
 {
        struct sock *sk = sock->sk;
-       struct unix_sock *u = unix_sk(sk);
+       struct unix_sock *u;
        struct sockaddr_un *sunaddr=(struct sockaddr_un *)uaddr;
        int err = 0;
 
@@ -1124,6 +1124,7 @@ static int unix_getname(struct socket *sock, struct sockaddr *uaddr, int *uaddr_
                sock_hold(sk);
        }
 
+       u = unix_sk(sk);
        unix_state_rlock(sk);
        if (!u->addr) {
                sunaddr->sun_family = AF_UNIX;