File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed
source/portable/BufferManagement
test/cbmc/proofs/ARP/ARP_OutputARPRequest_buffer_alloc1 Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -206,7 +206,7 @@ BaseType_t xNetworkBuffersInitialise( void )
206206 uxMaxNetworkInterfaceAllocatedSizeBytes = uxNetworkInterfaceAllocateRAMToBuffers ( xNetworkBuffers );
207207
208208 /* The allocated buffer should hold atleast ipconfigNETWORK_MTU + ipSIZE_OF_ETH_HEADER bytes */
209- configASSERT ( ( uxMaxNetworkInterfaceAllocatedSizeBytes >= ( ipconfigNETWORK_MTU + ipSIZE_OF_ETH_HEADER ) ) )
209+ configASSERT ( ( uxMaxNetworkInterfaceAllocatedSizeBytes >= ( ipconfigNETWORK_MTU + ipSIZE_OF_ETH_HEADER ) ) );
210210
211211 for ( x = 0U ; x < ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS ; x ++ )
212212 {
Original file line number Diff line number Diff line change 2525
2626size_t uxNetworkInterfaceAllocateRAMToBuffers ( NetworkBufferDescriptor_t pxNetworkBuffers [ ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS ] )
2727{
28+ /*
29+ In the case of buffer allocation scheme 1 the network buffers are
30+ fixed size and its asserted in xNetworkBuffersInitialise call that the
31+ buffer is at least ipconfigNETWORK_MTU + ipSIZE_OF_ETH_HEADER bytes
32+
33+ Refer:
34+ configASSERT( ( uxMaxNetworkInterfaceAllocatedSizeBytes >= ( ipconfigNETWORK_MTU + ipSIZE_OF_ETH_HEADER ) ) );
35+
36+ */
37+ size_t xAllocSize = 0 ;
2838 for ( int x = 0 ; x < ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS ; x ++ )
2939 {
3040 NetworkBufferDescriptor_t * current = & pxNetworkBuffers [ x ];
31- size_t xAllocSize ;
32- #if ( ipconfigETHERNET_MINIMUM_PACKET_BYTES > 0 )
33- xAllocSize = sizeof ( ARPPacket_t ) + ( ipconfigETHERNET_MINIMUM_PACKET_BYTES - sizeof ( ARPPacket_t ) );
34- current -> pucEthernetBuffer = malloc ( xAllocSize );
35- #else
36- xAllocSize = sizeof ( ARPPacket_t )
37- current -> pucEthernetBuffer = malloc ( xAllocSize );
38- #endif
41+ xAllocSize = ipconfigNETWORK_MTU + ipSIZE_OF_ETH_HEADER ;
42+ current -> pucEthernetBuffer = malloc ( xAllocSize );
3943 __CPROVER_assume ( current -> pucEthernetBuffer != NULL );
4044 current -> xDataLength = sizeof ( ARPPacket_t );
4145 }
You can’t perform that action at this time.
0 commit comments