[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

svn path=/trunk/; revision=48493
This commit is contained in:
Cameron Gutman
2010-08-09 20:37:32 +00:00
parent 55f39ef1a3
commit 6cb85c8ae3
+10 -1
View File
@@ -209,7 +209,7 @@ DWORD WINAPI AdapterDiscoveryThread(LPVOID Context) {
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 @@ DWORD WINAPI AdapterDiscoveryThread(LPVOID Context) {
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 =