diff options
author | Dean Camera <[email protected]> | 2009-08-07 06:55:31 +0000 |
---|---|---|
committer | Dean Camera <[email protected]> | 2009-08-07 06:55:31 +0000 |
commit | d423090b26ade8912e669d6c6d3c5463e0669429 (patch) | |
tree | f443783209b96313146c539de92c408788d2778d /Demos/Device/ClassDriver/RNDISEthernet/Lib/UDP.c | |
parent | 85c2716f2d37bb50d126102fcdd09fb78d26ebc5 (diff) | |
download | qmk_firmware-d423090b26ade8912e669d6c6d3c5463e0669429.tar.gz qmk_firmware-d423090b26ade8912e669d6c6d3c5463e0669429.zip |
Cleanups to RNDIS device demos. Fix issue in RNDIS demos where the memory would become corrupted due to an incorrect bounds check when iterating over the port state table, causing random resets.
Revert change to Template_Endpoint_Control_R.c, which broke control stream reads.
Remove uneeded ADC.h include in the class driver AudioOutput demo.
Diffstat (limited to 'Demos/Device/ClassDriver/RNDISEthernet/Lib/UDP.c')
-rw-r--r-- | Demos/Device/ClassDriver/RNDISEthernet/Lib/UDP.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/UDP.c b/Demos/Device/ClassDriver/RNDISEthernet/Lib/UDP.c index dbd33d15d4..ea679512bc 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/UDP.c +++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/UDP.c @@ -55,12 +55,13 @@ int16_t UDP_ProcessUDPPacket(void* IPHeaderInStart, void* UDPHeaderInStart, void DecodeUDPHeader(UDPHeaderInStart);
- /* Check to see if the UDP packet is a DHCP packet */
- if (SwapEndian_16(UDPHeaderIN->DestinationPort) == UDP_PORT_DHCP_REQUEST)
+ switch (SwapEndian_16(UDPHeaderIN->DestinationPort))
{
- RetSize = DHCP_ProcessDHCPPacket(IPHeaderInStart,
- &((uint8_t*)UDPHeaderInStart)[sizeof(UDP_Header_t)],
- &((uint8_t*)UDPHeaderOutStart)[sizeof(UDP_Header_t)]);
+ case UDP_PORT_DHCP_REQUEST:
+ RetSize = DHCP_ProcessDHCPPacket(IPHeaderInStart,
+ &((uint8_t*)UDPHeaderInStart)[sizeof(UDP_Header_t)],
+ &((uint8_t*)UDPHeaderOutStart)[sizeof(UDP_Header_t)]);
+ break;
}
/* Check to see if the protocol processing routine has filled out a response */
|