Formatting uecho.c
@@ -24,7 +24,6 @@ void uecho_init(void) {
}
void uecho_receive(OpenQueueEntry_t *request) {
- uint16_t temp_l4_destination_port;
OpenQueueEntry_t *reply;
if (request->length > 60) {
@@ -49,9 +48,8 @@ void uecho_receive(OpenQueueEntry_t* request) {
// reply with the same OpenQueueEntry_t
reply->creator = COMPONENT_UECHO;
reply->l4_protocol = IANA_UDP;
- temp_l4_destination_port = request->l4_destination_port;
reply->l4_destination_port = request->l4_sourcePortORicmpv6Type;
- reply->l4_sourcePortORicmpv6Type = temp_l4_destination_port;
+ reply->l4_sourcePortORicmpv6Type = request->l4_destination_port;
reply->l3_destinationAdd.type = ADDR_128B;
// copy source to destination to echo.
@@ -59,6 +57,7 @@ void uecho_receive(OpenQueueEntry_t* request) {
packetfunctions_reserveHeaderSize(reply, request->length);
memcpy(&reply->payload[0], &request->payload[0], request->length);
+
openqueue_freePacketBuffer(request);
if ((openudp_send(reply)) == E_FAIL) {
