Re: getpeername broken? ( was Re: probably problem with "lo" interface (Re: Strange problem with 2.3.42) )

From: David S. Miller (davem@redhat.com)
Date: Thu Feb 03 2000 - 20:58:37 EST


Can people try this patch? Thanks.

--- net/ipv4/af_inet.c.~1~ Tue Jan 18 00:24:14 2000
+++ net/ipv4/af_inet.c Thu Feb 3 12:36:46 2000
@@ -5,7 +5,7 @@
  *
  * PF_INET protocol family socket handler.
  *
- * Version: $Id: af_inet.c,v 1.104 2000/01/18 08:24:14 davem Exp $
+ * Version: $Id: af_inet.c,v 1.105 2000/02/03 20:36:46 davem Exp $
  *
  * Authors: Ross Biro, <bir7@leland.Stanford.Edu>
  * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
@@ -675,7 +675,7 @@
   
         sin->sin_family = AF_INET;
         if (peer) {
- if (!sk->dport)
+ if (!sk->dport || sk->state == TCP_SYN_SENT)
                         return -ENOTCONN;
                 sin->sin_port = sk->dport;
                 sin->sin_addr.s_addr = sk->daddr;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Feb 07 2000 - 21:00:10 EST