Author: cgutman Date: Mon Aug 9 20:37:32 2010 New Revision: 48493
URL: http://svn.reactos.org/svn/reactos?rev=48493&view=rev Log: [DHCPCSVC] - Set the SO_BROADCAST option to 1 before we send data to the broadcast address so we don't get stonewalled by mswsock - DHCP is now compatible with mswsock_new
Modified: trunk/reactos/dll/win32/dhcpcsvc/dhcp/adapter.c
Modified: trunk/reactos/dll/win32/dhcpcsvc/dhcp/adapter.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/dhcpcsvc/dhcp/ada... ============================================================================== --- trunk/reactos/dll/win32/dhcpcsvc/dhcp/adapter.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/dhcpcsvc/dhcp/adapter.c [iso-8859-1] Mon Aug 9 20:37:32 2010 @@ -209,7 +209,7 @@ PDHCP_ADAPTER Adapter = NULL; HANDLE AdapterStateChangedEvent = (HANDLE)Context; struct interface_info *ifi = NULL; - int i, AdapterCount = 0; + int i, AdapterCount = 0, Broadcast;
/* FIXME: Kill this thread when the service is stopped */
@@ -285,6 +285,15 @@ socket( AF_INET, SOCK_DGRAM, IPPROTO_UDP );
if (DhcpSocket != INVALID_SOCKET) { + + /* Allow broadcast on this socket */ + Broadcast = 1; + setsockopt(DhcpSocket, + SOL_SOCKET, + SO_BROADCAST, + (const char *)&Broadcast, + sizeof(Broadcast)); + Adapter->ListenAddr.sin_family = AF_INET; Adapter->ListenAddr.sin_port = htons(LOCAL_PORT); Adapter->BindStatus =