X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/f1076ac4d6e56bff7fb6d2126746af1108211370..c1fa2306181924ebd8b36b0e3910b7904143beb8:/Demos/Device/LowLevel/RNDISEthernet/Lib/UDP.c?ds=sidebyside diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/UDP.c b/Demos/Device/LowLevel/RNDISEthernet/Lib/UDP.c index dbd33d15d..4338d3ea8 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/UDP.c +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/UDP.c @@ -38,7 +38,7 @@ #include "UDP.h" /** Processes a UDP packet inside an Ethernet frame, and writes the appropriate response - * to the output Ethernet frame if a subprotocol handler has created a response packet. + * to the output Ethernet frame if a sub-protocol handler has created a response packet. * * \param[in] IPHeaderInStart Pointer to the start of the incoming packet's IP header * \param[in] UDPHeaderInStart Pointer to the start of the incoming packet's UDP header @@ -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 */