From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27691 invoked from network); 25 Apr 2002 13:17:39 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 25 Apr 2002 13:17:39 -0000 Received: (qmail 10841 invoked by alias); 25 Apr 2002 13:17:31 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 17040 Received: (qmail 10822 invoked from network); 25 Apr 2002 13:17:29 -0000 To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: PATCH: tcp socket handling Date: Thu, 25 Apr 2002 14:16:42 +0100 Message-ID: <5604.1019740602@csr.com> From: Peter Stephenson Found a bug when trying to get IPv6 to work. There could be more, since although I can connect to the server it's giving odd responses which it doesn't when I use IPv4. The other change is simply a change of logic, since peer.in and peer.a are alternative members of a union. Actually, the family is (has to be) in the same place in all forms of sockaddr, but I like the look of it the new way. Index: Src/Modules/tcp.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Modules/tcp.c,v retrieving revision 1.22 diff -u -r1.22 tcp.c --- Src/Modules/tcp.c 18 Apr 2002 11:39:15 -0000 1.22 +++ Src/Modules/tcp.c 25 Apr 2002 13:12:28 -0000 @@ -322,13 +322,14 @@ # ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID sess->peer.in6.sin6_scope_id = 0; # endif + sess->peer.in6.sin6_family = zhost->h_addrtype; salen = sizeof(struct sockaddr_in6); } else #endif /* SUPPORT_IPV6 */ { memcpy(&(sess->peer.in.sin_addr), addrp, zhost->h_length); sess->peer.in.sin_port = d_port; - sess->peer.a.sa_family = zhost->h_addrtype; + sess->peer.in.sin_family = zhost->h_addrtype; salen = sizeof(struct sockaddr_in); } -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 392070 ********************************************************************** The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. **********************************************************************