X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/85c2716f2d37bb50d126102fcdd09fb78d26ebc5..d423090b26ade8912e669d6c6d3c5463e0669429:/Demos/Device/LowLevel/RNDISEthernet/Lib/UDP.c diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/UDP.c b/Demos/Device/LowLevel/RNDISEthernet/Lib/UDP.c index dbd33d15d..ea679512b 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/UDP.c +++ b/Demos/Device/LowLevel/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 */