File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 66 " --unwindset prvCacheLookup.0:7" ,
77 " --unwindset FreeRTOS_FindEndPointOnIP_IPv4.0:3" ,
88 " --unwindset FreeRTOS_InterfaceEndPointOnNetMask.0:3" ,
9+ " --unwindset xIsIPv4Broadcast.0:3" ,
910 " --unwindset eARPGetCacheEntry.0:3" ,
1011 " --unwindset FreeRTOS_FindGateWay.0:3" ,
1112 " --nondet-static"
Original file line number Diff line number Diff line change @@ -157,7 +157,8 @@ void harness()
157157 NetworkBufferDescriptor_t * const pxNetworkBuffer = safeMalloc ( sizeof ( NetworkBufferDescriptor_t ) );
158158 uint8_t * pucEthernetBuffer = ( uint8_t * ) safeMalloc ( ipTOTAL_ETHERNET_FRAME_SIZE + ipIP_TYPE_OFFSET );
159159 EthernetHeader_t * pxHeader ;
160-
160+ NetworkEndPoint_t xEndPoint ;
161+
161162 __CPROVER_assume ( pxNetworkBuffer != NULL );
162163 __CPROVER_assume ( pucEthernetBuffer != NULL );
163164
@@ -166,6 +167,19 @@ void harness()
166167 pxNetworkBuffer -> pucEthernetBuffer = & ( pucEthernetBuffer [ ipIP_TYPE_OFFSET ] );
167168 __CPROVER_assume ( pxNetworkBuffer -> pucEthernetBuffer != NULL );
168169
170+ /* prvProcessIPPacket is guranteed to receive a network buffer that has a valid
171+ endpoint, hence no NULL checks are needed to be performed inside prvProcessIPPacket.
172+ See the check:
173+
174+ if( ( pxNetworkBuffer->pxInterface == NULL ) || ( pxNetworkBuffer->pxEndPoint == NULL ) )
175+ {
176+ break;
177+ }
178+
179+ inside the prvProcessEthernetPacket before which prvProcessIPPacket is called.
180+ */
181+ pxNetworkBuffer -> pxEndPoint = & xEndPoint ;
182+
169183 /* Minimum length of the pxNetworkBuffer->xDataLength is at least the size of the IPPacket_t. */
170184 __CPROVER_assume ( pxNetworkBuffer -> xDataLength >= sizeof ( IPPacket_t ) && pxNetworkBuffer -> xDataLength <= ipTOTAL_ETHERNET_FRAME_SIZE );
171185
You can’t perform that action at this time.
0 commit comments