aboutsummaryrefslogtreecommitdiffstats
path: root/Projects/Webserver
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-02-12 05:05:03 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-02-12 05:05:03 +0000
commit41ef05a6e559a10134967e8a899aab78c556b645 (patch)
tree6214c29f21f45d4245f498d0e0306ef98264dfe4 /Projects/Webserver
parenta71820b259577c3cb0efd6c04b5168551a16a6e1 (diff)
downloadlufa-41ef05a6e559a10134967e8a899aab78c556b645.tar.gz
lufa-41ef05a6e559a10134967e8a899aab78c556b645.tar.bz2
lufa-41ef05a6e559a10134967e8a899aab78c556b645.zip
Fix DHCPClient init code in the Webserver project writing to the incorrect application state location (thanks to Mike Alexander).
Diffstat (limited to 'Projects/Webserver')
-rw-r--r--Projects/Webserver/Lib/DHCPClientApp.c22
-rw-r--r--Projects/Webserver/Lib/uip/uipopt.h1
-rw-r--r--Projects/Webserver/makefile1
3 files changed, 13 insertions, 11 deletions
diff --git a/Projects/Webserver/Lib/DHCPClientApp.c b/Projects/Webserver/Lib/DHCPClientApp.c
index 2097062f8..0e51d5707 100644
--- a/Projects/Webserver/Lib/DHCPClientApp.c
+++ b/Projects/Webserver/Lib/DHCPClientApp.c
@@ -43,17 +43,19 @@ struct timer DHCPTimer;
/** Initialization function for the DHCP client. */
void DHCPClientApp_Init(void)
{
- uip_udp_appstate_t* const AppState = &uip_udp_conn->appstate;
-
- /* Create a new UDP connection to the DHCP server port for the DHCP solicitation */
+ /* Create an IP address to the broadcast network address */
uip_ipaddr_t DHCPServerIPAddress;
uip_ipaddr(&DHCPServerIPAddress, 255, 255, 255, 255);
- AppState->DHCPClient.Connection = uip_udp_new(&DHCPServerIPAddress, HTONS(DHCPC_SERVER_PORT));
+
+ /* Create a new UDP connection to the DHCP server port for the DHCP solicitation */
+ struct uip_udp_conn* Connection = uip_udp_new(&DHCPServerIPAddress, HTONS(DHCPC_SERVER_PORT));
/* If the connection was successfully created, bind it to the local DHCP client port */
- if(AppState->DHCPClient.Connection != NULL)
+ if (Connection != NULL)
{
- uip_udp_bind(AppState->DHCPClient.Connection, HTONS(DHCPC_CLIENT_PORT));
+ uip_udp_appstate_t* const AppState = &Connection->appstate;
+
+ uip_udp_bind(Connection, HTONS(DHCPC_CLIENT_PORT));
AppState->DHCPClient.CurrentState = DHCP_STATE_SendDiscover;
}
@@ -188,13 +190,13 @@ uint16_t DHCPClientApp_FillDHCPHeader(DHCP_Header_t* DHCPHeader, uint8_t DHCPMes
DHCPHeader->TransactionID = DHCP_TRANSACTION_ID;
DHCPHeader->ElapsedSeconds = 0;
DHCPHeader->Flags = HTONS(BOOTP_BROADCAST);
- memcpy(&DHCPHeader->ClientIP, &uip_hostaddr, sizeof(uip_ipaddr_t));
- memcpy(&DHCPHeader->YourIP, &AppState->DHCPClient.DHCPOffer_Data.AllocatedIP, sizeof(uip_ipaddr_t));
- memcpy(&DHCPHeader->NextServerIP, &AppState->DHCPClient.DHCPOffer_Data.ServerIP, sizeof(uip_ipaddr_t));
+ memcpy(&DHCPHeader->ClientIP, &uip_hostaddr, sizeof(uip_ipaddr_t));
+ memcpy(&DHCPHeader->YourIP, &AppState->DHCPClient.DHCPOffer_Data.AllocatedIP, sizeof(uip_ipaddr_t));
+ memcpy(&DHCPHeader->NextServerIP, &AppState->DHCPClient.DHCPOffer_Data.ServerIP, sizeof(uip_ipaddr_t));
memcpy(&DHCPHeader->ClientHardwareAddress, &MACAddress, sizeof(struct uip_eth_addr));
DHCPHeader->Cookie = DHCP_MAGIC_COOKIE;
- /* Add a DHCP type and terminator options to the start of the DHCP options field */
+ /* Add a DHCP message type and terminator options to the start of the DHCP options field */
DHCPHeader->Options[0] = DHCP_OPTION_MSG_TYPE;
DHCPHeader->Options[1] = 1;
DHCPHeader->Options[2] = DHCPMessageType;
diff --git a/Projects/Webserver/Lib/uip/uipopt.h b/Projects/Webserver/Lib/uip/uipopt.h
index c8d0cd202..8a09c7248 100644
--- a/Projects/Webserver/Lib/uip/uipopt.h
+++ b/Projects/Webserver/Lib/uip/uipopt.h
@@ -717,7 +717,6 @@ typedef union
struct
{
uint8_t CurrentState;
- struct uip_udp_conn* Connection;
struct
{
diff --git a/Projects/Webserver/makefile b/Projects/Webserver/makefile
index 2097988b3..b0e26f3a4 100644
--- a/Projects/Webserver/makefile
+++ b/Projects/Webserver/makefile
@@ -119,6 +119,7 @@ LUFA_PATH = ../../
LUFA_OPTS = -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
+LUFA_OPTS += -D FAST_STREAM_TRANSFERS
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"