Author: cgutman
Date: Fri Jul 1 15:08:59 2011
New Revision: 52498
URL:
http://svn.reactos.org/svn/reactos?rev=52498&view=rev
Log:
[OSKITTCP]
- Set SO_REUSEPORT on new sockets to allow binding to ports shared by sockets which are
closed according to upper layers of tcpip but still pending a close in oskittcp (see the
BSD try-10-times hack)
- Fill all members of the sockaddr_in struct when fulfilling a query accept request
Modified:
trunk/reactos/lib/drivers/oskittcp/oskittcp/interface.c
Modified: trunk/reactos/lib/drivers/oskittcp/oskittcp/interface.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/oskittcp/oskit…
==============================================================================
--- trunk/reactos/lib/drivers/oskittcp/oskittcp/interface.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/oskittcp/oskittcp/interface.c [iso-8859-1] Fri Jul 1
15:08:59 2011
@@ -117,7 +117,7 @@
void InitializeSocketFlags(struct socket *so)
{
so->so_state |= SS_NBIO;
- so->so_options |= SO_DONTROUTE;
+ so->so_options |= SO_DONTROUTE | SO_REUSEPORT;
so->so_snd.sb_flags |= SB_SEL;
so->so_rcv.sb_flags |= SB_SEL;
}
@@ -382,8 +382,9 @@
inp = so ? (struct inpcb *)so->so_pcb : NULL;
if( inp && name ) {
- ((struct sockaddr_in *)AddrOut)->sin_addr.s_addr =
- inp->inp_faddr.s_addr;
+ ((struct sockaddr_in *)AddrOut)->sin_len = sizeof(struct sockaddr_in);
+ ((struct sockaddr_in *)AddrOut)->sin_family = AF_INET;
+ ((struct sockaddr_in *)AddrOut)->sin_addr = inp->inp_faddr;
((struct sockaddr_in *)AddrOut)->sin_port = inp->inp_fport;
}