Ticket #2932: tcp_subr.diff
| File tcp_subr.diff, 1.6 KB (added by , 16 years ago) |
|---|
-
tcp_subr.c
old new 667 667 /* 668 668 * Need to emulate the PORT command 669 669 */ 670 struct sockaddr_in addr; 671 socklen_t addrlen = sizeof addr; 672 673 if ( getsockname(so->s,(struct sockaddr *)&addr,&addrlen)) 674 return 1; 675 670 676 x = sscanf(bptr, "ORT %u,%u,%u,%u,%u,%u\r\n%256[^\177]", 671 677 &n1, &n2, &n3, &n4, &n5, &n6, buff); 672 678 if (x < 6) … … 683 689 n5 = (n6 >> 8) & 0xff; 684 690 n6 &= 0xff; 685 691 686 laddr = ntohl( so->so_faddr.s_addr);692 laddr = ntohl(addr.sin_addr.s_addr); 687 693 688 694 n1 = ((laddr >> 24) & 0xff); 689 695 n2 = ((laddr >> 16) & 0xff); … … 700 706 /* 701 707 * Need to emulate the PASV response 702 708 */ 709 struct sockaddr_in addr; 710 socklen_t addrlen = sizeof addr; 711 712 if ( getsockname(so->s,(struct sockaddr *)&addr,&addrlen)) 713 return 1; 714 703 715 x = sscanf(bptr, "27 Entering Passive Mode (%u,%u,%u,%u,%u,%u)\r\n%256[^\177]", 704 716 &n1, &n2, &n3, &n4, &n5, &n6, buff); 705 717 if (x < 6) … … 716 728 n5 = (n6 >> 8) & 0xff; 717 729 n6 &= 0xff; 718 730 719 laddr = ntohl( so->so_faddr.s_addr);731 laddr = ntohl(addr.sin_addr.s_addr); 720 732 721 733 n1 = ((laddr >> 24) & 0xff); 722 734 n2 = ((laddr >> 16) & 0xff);

