Skip to content

Commit

Permalink
Fix CBMC proofs
Browse files Browse the repository at this point in the history
  • Loading branch information
tony-josi-aws committed Jan 9, 2024
1 parent 5a559a9 commit ffd7756
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
16 changes: 12 additions & 4 deletions test/cbmc/patches/FreeRTOSIPConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,13 @@
* set to 1 if a valid configuration cannot be obtained from a DHCP server for any
* reason. The static configuration used is that passed into the stack by the
* FreeRTOS_IPInit() function call. */
#define ipconfigUSE_DHCP 1
#ifndef ipconfigUSE_DHCP
#define ipconfigUSE_DHCP 1
#endif

#define ipconfigDHCP_REGISTER_HOSTNAME 1
#ifndef ipconfigDHCP_REGISTER_HOSTNAME
#define ipconfigDHCP_REGISTER_HOSTNAME 1
#endif

#define ipconfigDHCP_USES_UNICAST 1

Expand Down Expand Up @@ -230,11 +234,15 @@
* lower value can save RAM, depending on the buffer management scheme used. If
* ipconfigCAN_FRAGMENT_OUTGOING_PACKETS is 1 then (ipconfigNETWORK_MTU - 28) must
* be divisible by 8. */
#define ipconfigNETWORK_MTU 1500U
#ifndef ipconfigNETWORK_MTU
#define ipconfigNETWORK_MTU 1500U
#endif

/* Set ipconfigUSE_DNS to 1 to include a basic DNS client/resolver. DNS is used
* through the FreeRTOS_gethostbyname() API function. */
#define ipconfigUSE_DNS 1
#ifndef ipconfigUSE_DNS
#define ipconfigUSE_DNS 1
#endif

/* If ipconfigREPLY_TO_INCOMING_PINGS is set to 1 then the IP stack will
* generate replies to incoming ICMP echo (ping) requests. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ void harness()
/* Interface init. */
pxNetworkEndPoints->pxNetworkInterface = ( NetworkInterface_t * ) safeMalloc( sizeof( NetworkInterface_t ) );
__CPROVER_assume( pxNetworkEndPoints->pxNetworkInterface != NULL );
__CPROVER_assume( pxNetworkEndPoints->pxNetworkInterface->pfAddAllowedMAC == NULL );

if( nondet_bool() )
{
Expand Down
5 changes: 5 additions & 0 deletions test/cbmc/proofs/RA/vReceiveRA/ReceiveRA_harness.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ void harness()
NetworkInterface_t * pxInterface = ( NetworkInterface_t * ) safeMalloc( sizeof( NetworkInterface_t ) );
uint32_t ulLen;

if( pxInterface != NULL )
{
__CPROVER_assume( pxInterface->pfAddAllowedMAC == NULL );
}

/* The code does not expect pxNetworkBuffer to be NULL. */
__CPROVER_assume( pxNetworkBuffer != NULL );

Expand Down

0 comments on commit ffd7756

Please sign in to comment.