aboutsummaryrefslogtreecommitdiff
path: root/Demos/Device/ClassDriver/RNDISEthernet/Lib/Ethernet.c
diff options
context:
space:
mode:
authorDean Camera <[email protected]>2009-08-07 06:55:31 +0000
committerDean Camera <[email protected]>2009-08-07 06:55:31 +0000
commitd423090b26ade8912e669d6c6d3c5463e0669429 (patch)
treef443783209b96313146c539de92c408788d2778d /Demos/Device/ClassDriver/RNDISEthernet/Lib/Ethernet.c
parent85c2716f2d37bb50d126102fcdd09fb78d26ebc5 (diff)
downloadqmk_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/Ethernet.c')
-rw-r--r--Demos/Device/ClassDriver/RNDISEthernet/Lib/Ethernet.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/Ethernet.c b/Demos/Device/ClassDriver/RNDISEthernet/Lib/Ethernet.c
index fb6bb1aab9..70033f5289 100644
--- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/Ethernet.c
+++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/Ethernet.c
@@ -59,7 +59,7 @@ const IP_Address_t ClientIPAddress = {CLIENT_IP_ADDRESS};
*/
void Ethernet_ProcessPacket(Ethernet_Frame_Info_t* FrameIN, Ethernet_Frame_Info_t* FrameOUT)
{
- DecodeEthernetFrameHeader(FrameIN->FrameData);
+ DecodeEthernetFrameHeader(FrameIN);
/* Cast the incoming Ethernet frame to the Ethernet header type */
Ethernet_Frame_Header_t* FrameINHeader = (Ethernet_Frame_Header_t*)&FrameIN->FrameData;
@@ -69,7 +69,8 @@ void Ethernet_ProcessPacket(Ethernet_Frame_Info_t* FrameIN, Ethernet_Frame_Info_
/* Ensure frame is addressed to either all (broadcast) or the virtual webserver, and is a type II frame */
if ((MAC_COMPARE(&FrameINHeader->Destination, &ServerMACAddress) ||
- MAC_COMPARE(&FrameINHeader->Destination, &BroadcastMACAddress)))
+ MAC_COMPARE(&FrameINHeader->Destination, &BroadcastMACAddress)) &&
+ (SwapEndian_16(FrameIN->FrameLength) > ETHERNET_VER2_MINSIZE))
{
/* Process the packet depending on its protocol */
switch (SwapEndian_16(FrameINHeader->EtherType))