Skip to content

Conversation

@tony-josi-aws
Copy link
Member

This PR fixes the build issues and proof failures for the DHCP CBMC proofs post the IPv6 changes.

Test Steps

cd test/cbmc/proofs/
python run-cbmc-proofs.py

Related Issue

Failing CBMC proofs

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

karkhaz and others added 11 commits February 8, 2023 06:00
Prior to this commit, CBMC would emit logging information in plain text
format, which does not contain information required for the CBMC VSCode
debugger. This commit makes CBMC use XML instead of plain text.

Co-authored-by: Mark Tuttle <[email protected]>
@tony-josi-aws tony-josi-aws requested a review from a team as a code owner February 14, 2023 19:18
lBytes = FreeRTOS_recvfrom( xDHCPv4Socket, &( pucUDPPayload ), 0, FREERTOS_ZERO_COPY, NULL, NULL );

if( lBytes > 0 )
if( lBytes > 0 && pucUDPPayload != NULL )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if( lBytes > 0 && pucUDPPayload != NULL )
if( ( lBytes > 0 ) && ( pucUDPPayload != NULL ) )

Copy link
Member Author

@tony-josi-aws tony-josi-aws Feb 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed all formatting issues

}

FreeRTOS_ReleaseUDPPayloadBuffer( pucUDPPayload );
if (pucUDPPayload != NULL)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (pucUDPPayload != NULL)
if( pucUDPPayload != NULL )

pxEndPoint );

if( pucUDPPayloadBuffer != NULL )
if( xDHCPv4Socket != FREERTOS_INVALID_SOCKET && xDHCPv4Socket != NULL && pucUDPPayloadBuffer != NULL )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if( xDHCPv4Socket != FREERTOS_INVALID_SOCKET && xDHCPv4Socket != NULL && pucUDPPayloadBuffer != NULL )
if( ( xDHCPv4Socket != FREERTOS_INVALID_SOCKET ) &&
( xDHCPv4Socket != NULL ) &&
( pucUDPPayloadBuffer != NULL ) )

/* The packet was not successfully queued for sending and must be
* returned to the stack. */
FreeRTOS_ReleaseUDPPayloadBuffer( pucUDPPayloadBuffer );
if (pucUDPPayloadBuffer != NULL)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (pucUDPPayloadBuffer != NULL)
if( pucUDPPayloadBuffer != NULL )

pxEndPoint );

if( pucUDPPayloadBuffer != NULL )
if( xDHCPv4Socket != FREERTOS_INVALID_SOCKET && xDHCPv4Socket != NULL && pucUDPPayloadBuffer != NULL )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if( xDHCPv4Socket != FREERTOS_INVALID_SOCKET && xDHCPv4Socket != NULL && pucUDPPayloadBuffer != NULL )
if( ( xDHCPv4Socket != FREERTOS_INVALID_SOCKET ) &&
( xDHCPv4Socket != NULL ) &&
( pucUDPPayloadBuffer != NULL ) )

/* The packet was not successfully queued for sending and must be
* returned to the stack. */
FreeRTOS_ReleaseUDPPayloadBuffer( pucUDPPayloadBuffer );
if (pucUDPPayloadBuffer != NULL)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (pucUDPPayloadBuffer != NULL)
if( pucUDPPayloadBuffer != NULL )

size_t uxAddressLength,
BaseType_t xInternal )
{
return 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to verify the pointers being valid?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

{
const char * name;

name = "hostname";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not make if non-deterministic too?

uint8_t size_of_hostname;
name = malloc( size_of_hostname );

BaseType_t xReset;
eDHCPState_t eExpectedState;
BaseType_t xDoCheck;
//eDHCPState_t eExpectedState;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused comment?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Comment on lines 138 to 140
#ifndef ipconfigDHCP_REGISTER_HOSTNAME
#define ipconfigDHCP_REGISTER_HOSTNAME 1
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

@tony-josi-aws tony-josi-aws merged commit d0fbbd3 into FreeRTOS:dev/IPv6_integration Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants