Author: cgutman
Date: Sun Jan 31 03:07:23 2010
New Revision: 45356
URL:
http://svn.reactos.org/svn/reactos?rev=45356&view=rev
Log:
- Merge some small changes from aicom-network-branch to fix potential memory corruption
and remove unused code in oskittcp
- Add a hack to WSHSetSocketInformation so we don't fail with options that aren't
implemented yet
- Fixes bug #5131
Modified:
trunk/reactos/dll/win32/wshtcpip/wshtcpip.c
trunk/reactos/lib/drivers/oskittcp/include/freebsd/src/sys/sys/mbuf.h
trunk/reactos/lib/drivers/oskittcp/include/oskitfreebsd.h
trunk/reactos/lib/drivers/oskittcp/oskittcp/uipc_mbuf.c
Modified: trunk/reactos/dll/win32/wshtcpip/wshtcpip.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wshtcpip/wshtcpi…
==============================================================================
--- trunk/reactos/dll/win32/wshtcpip/wshtcpip.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/wshtcpip/wshtcpip.c [iso-8859-1] Sun Jan 31 03:07:23 2010
@@ -623,8 +623,10 @@
/* FIXME: We only handle address file object here */
RealOptionName = GetAddressOption(Level, OptionName);
+
+ /* FIXME: Support all options */
if (!RealOptionName)
- return WSAEINVAL;
+ return 0; /* return WSAEINVAL; */
Info = HeapAlloc(GetProcessHeap(), 0, sizeof(*Info) + OptionLength);
if (!Info)
Modified: trunk/reactos/lib/drivers/oskittcp/include/freebsd/src/sys/sys/mbuf.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/oskittcp/inclu…
==============================================================================
--- trunk/reactos/lib/drivers/oskittcp/include/freebsd/src/sys/sys/mbuf.h [iso-8859-1]
(original)
+++ trunk/reactos/lib/drivers/oskittcp/include/freebsd/src/sys/sys/mbuf.h [iso-8859-1] Sun
Jan 31 03:07:23 2010
@@ -55,13 +55,6 @@
#ifndef M_WAITOK
#include <sys/malloc.h>
-#endif
-
-#ifndef OSKIT
-#ifdef __REACTOS__
-/* #define OSKIT */
-#define LOCAL_OSKIT_DEFINED
-#endif
#endif
/*
@@ -301,21 +294,6 @@
} \
)
-#ifdef __REACTOS__
-#define MCLGET(m, how) { \
- OS_DbgPrint(OSK_MID_TRACE,("(MCLGET) m = %x\n", m)); \
- (m)->m_ext.ext_buf = malloc(MCLBYTES,__FILE__,__LINE__); \
- if ((m)->m_ext.ext_buf != NULL) { \
- (m)->m_data = (m)->m_ext.ext_buf; \
- (m)->m_flags |= M_EXT; \
- (m)->m_ext.ext_size = MCLBYTES; \
- } \
- }
-
-#define MCLFREE(p) { \
- free( (p), 0 ); \
- }
-#else
#define MCLGET(m, how) \
{ MCLALLOC((m)->m_ext.ext_buf, (how)); \
OS_DbgPrint(OSK_MID_TRACE,("(MCLGET) m = %x\n", m)); \
@@ -335,7 +313,6 @@
mbstat.m_clfree++; \
} \
)
-#endif
#else
#define MCLGET(m, how) \
{ (m)->m_ext.ext_bufio = oskit_bufio_create(MCLBYTES); \
@@ -557,9 +534,4 @@
#endif
#endif
-#ifdef LOCAL_OSKIT_DEFINED
-#undef LOCAL_OSKIT_DEFINED
-#undef OSKIT
-#endif
-
#endif /* !_SYS_MBUF_H_ */
Modified: trunk/reactos/lib/drivers/oskittcp/include/oskitfreebsd.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/oskittcp/inclu…
==============================================================================
--- trunk/reactos/lib/drivers/oskittcp/include/oskitfreebsd.h [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/oskittcp/include/oskitfreebsd.h [iso-8859-1] Sun Jan 31
03:07:23 2010
@@ -14,7 +14,7 @@
#define printf DbgPrint
#define vprintf DbgVPrint
-#define ovbcopy(x,y,z) bcopy(x,y,z)
+#define ovbcopy(src,dst,n) memmove(dst,src,n)
#define bzero(x,y) memset(x,0,y)
#define bcopy(src,dst,n) memcpy(dst,src,n)
#ifdef _MSC_VER
Modified: trunk/reactos/lib/drivers/oskittcp/oskittcp/uipc_mbuf.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/oskittcp/oskit…
==============================================================================
--- trunk/reactos/lib/drivers/oskittcp/oskittcp/uipc_mbuf.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/oskittcp/oskittcp/uipc_mbuf.c [iso-8859-1] Sun Jan 31
03:07:23 2010
@@ -365,9 +365,7 @@
#ifdef OSKIT
oskit_bufio_addref(m->m_ext.ext_bufio);
#else
-#ifndef __REACTOS__
mclrefcnt[mtocl(m->m_ext.ext_buf)]++;
-#endif
#endif /* OSKIT */
n->m_ext = m->m_ext;
n->m_flags |= M_EXT;
@@ -729,11 +727,7 @@
if (copy)
copy(cp, mtod(m, caddr_t), (unsigned)len);
else
-#ifdef __REACTOS__
- memcpy(mtod(m, caddr_t), cp, len);
-#else
bcopy(cp, mtod(m, caddr_t), (unsigned)len);
-#endif
cp += len;
*mp = m;
mp = &m->m_next;