/*\r
- * FreeRTOS+TCP V2.0.11\r
+ * FreeRTOS+TCP V2.2.0\r
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\r
*\r
* Permission is hereby granted, free of charge, to any person obtaining a copy of\r
}\r
}\r
#endif\r
+ if( xIsCallingFromIPTask() != 0 )\r
+ {\r
+ /* Only the IP-task is allowed to call this function directly. */\r
+ xNetworkInterfaceOutput( pxNetworkBuffer, pdTRUE );\r
+ }\r
+ else\r
+ {\r
+ IPStackEvent_t xSendEvent;\r
\r
- xNetworkInterfaceOutput( pxNetworkBuffer, pdTRUE );\r
+ /* Send a message to the IP-task to send this ARP packet. */\r
+ xSendEvent.eEventType = eNetworkTxEvent;\r
+ xSendEvent.pvData = ( void * ) pxNetworkBuffer;\r
+ if( xSendEventStructToIPTask( &xSendEvent, ( TickType_t ) portMAX_DELAY ) == pdFAIL )\r
+ {\r
+ /* Failed to send the message, so release the network buffer. */\r
+ vReleaseNetworkBufferAndDescriptor( pxNetworkBuffer );\r
+ }\r
+ }\r
}\r
}\r
\r
{\r
ARPPacket_t *pxARPPacket;\r
\r
+ /* Buffer allocation ensures that buffers always have space\r
+ for an ARP packet. See buffer allocation implementations 1\r
+ and 2 under portable/BufferManagement. */\r
+ configASSERT( pxNetworkBuffer );\r
+ configASSERT( pxNetworkBuffer->xDataLength >= sizeof(ARPPacket_t) );\r
+\r
pxARPPacket = ( ARPPacket_t * ) pxNetworkBuffer->pucEthernetBuffer;\r
\r
/* memcpy the const part of the header information into the correct\r