Skip to content

Commit

Permalink
Revert "Uncrustify: triggered by comment."
Browse files Browse the repository at this point in the history
This reverts commit 983cda8.
  • Loading branch information
moninom1 committed Sep 14, 2023
1 parent 86e97e8 commit 6fc5569
Show file tree
Hide file tree
Showing 96 changed files with 3,505 additions and 3,505 deletions.
56 changes: 28 additions & 28 deletions source/FreeRTOS_ARP.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,16 +242,16 @@ static TickType_t xLastGratuitousARPTime = 0U;

/* Process received ARP frame to see if there is a clash. */
#if ( ipconfigARP_USE_CLASH_DETECTION != 0 )
{
NetworkEndPoint_t * pxSourceEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( ulSenderProtocolAddress, 2 );

if( ( pxSourceEndPoint != NULL ) && ( pxSourceEndPoint->ipv4_settings.ulIPAddress == ulSenderProtocolAddress ) )
{
xARPHadIPClash = pdTRUE;
/* Remember the MAC-address of the other device which has the same IP-address. */
( void ) memcpy( xARPClashMacAddress.ucBytes, pxARPHeader->xSenderHardwareAddress.ucBytes, sizeof( xARPClashMacAddress.ucBytes ) );
NetworkEndPoint_t * pxSourceEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( ulSenderProtocolAddress, 2 );

if( ( pxSourceEndPoint != NULL ) && ( pxSourceEndPoint->ipv4_settings.ulIPAddress == ulSenderProtocolAddress ) )
{
xARPHadIPClash = pdTRUE;
/* Remember the MAC-address of the other device which has the same IP-address. */
( void ) memcpy( xARPClashMacAddress.ucBytes, pxARPHeader->xSenderHardwareAddress.ucBytes, sizeof( xARPClashMacAddress.ucBytes ) );
}
}
}
#endif /* ipconfigARP_USE_CLASH_DETECTION */
}
else
Expand Down Expand Up @@ -845,21 +845,21 @@ static BaseType_t prvFindCacheEntry( const MACAddress_t * pxMACAddress,
* is different. Continue looping to find a possible match with
* ulIPAddress. */
#if ( ipconfigARP_STORES_REMOTE_ADDRESSES != 0 )
{
/* If ARP stores the MAC address of IP addresses outside the
* network, than the MAC address of the gateway should not be
* overwritten. */
BaseType_t xOtherIsLocal = ( FreeRTOS_FindEndPointOnNetMask( xARPCache[ x ].ulIPAddress, 3 ) != NULL ) ? 1 : 0; /* ARP remote address. */
{
/* If ARP stores the MAC address of IP addresses outside the
* network, than the MAC address of the gateway should not be
* overwritten. */
BaseType_t xOtherIsLocal = ( FreeRTOS_FindEndPointOnNetMask( xARPCache[ x ].ulIPAddress, 3 ) != NULL ) ? 1 : 0; /* ARP remote address. */

if( xAddressIsLocal == xOtherIsLocal )
if( xAddressIsLocal == xOtherIsLocal )
{
pxLocation->xMacEntry = x;
}
}
#else /* if ( ipconfigARP_STORES_REMOTE_ADDRESSES != 0 ) */
{
pxLocation->xMacEntry = x;
}
}
#else /* if ( ipconfigARP_STORES_REMOTE_ADDRESSES != 0 ) */
{
pxLocation->xMacEntry = x;
}
#endif /* if ( ipconfigARP_STORES_REMOTE_ADDRESSES != 0 ) */
}

Expand Down Expand Up @@ -1291,19 +1291,19 @@ void FreeRTOS_OutputARPRequest( uint32_t ulIPAddress )
vARPGenerateRequestPacket( pxNetworkBuffer );

#if ( ipconfigETHERNET_MINIMUM_PACKET_BYTES > 0 )
{
if( pxNetworkBuffer->xDataLength < ( size_t ) ipconfigETHERNET_MINIMUM_PACKET_BYTES )
{
BaseType_t xIndex;

for( xIndex = ( BaseType_t ) pxNetworkBuffer->xDataLength; xIndex < ( BaseType_t ) ipconfigETHERNET_MINIMUM_PACKET_BYTES; xIndex++ )
if( pxNetworkBuffer->xDataLength < ( size_t ) ipconfigETHERNET_MINIMUM_PACKET_BYTES )
{
pxNetworkBuffer->pucEthernetBuffer[ xIndex ] = 0U;
}
BaseType_t xIndex;

for( xIndex = ( BaseType_t ) pxNetworkBuffer->xDataLength; xIndex < ( BaseType_t ) ipconfigETHERNET_MINIMUM_PACKET_BYTES; xIndex++ )
{
pxNetworkBuffer->pucEthernetBuffer[ xIndex ] = 0U;
}

pxNetworkBuffer->xDataLength = ( size_t ) ipconfigETHERNET_MINIMUM_PACKET_BYTES;
pxNetworkBuffer->xDataLength = ( size_t ) ipconfigETHERNET_MINIMUM_PACKET_BYTES;
}
}
}
#endif /* if( ipconfigETHERNET_MINIMUM_PACKET_BYTES > 0 ) */

if( xIsCallingFromIPTask() != pdFALSE )
Expand Down
72 changes: 36 additions & 36 deletions source/FreeRTOS_DHCP.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,21 +422,21 @@
FreeRTOS_debug_printf( ( "vDHCPProcess: giving up %lu > %lu ticks\n", EP_DHCPData.xDHCPTxPeriod, ipconfigMAXIMUM_DISCOVER_TX_PERIOD ) );

#if ( ipconfigDHCP_FALL_BACK_AUTO_IP != 0 )
{
/* Only use a fake Ack if the default IP address == 0x00
* and the link local addressing is used. Start searching
* a free LinkLayer IP-address. Next state will be
* 'eGetLinkLayerAddress'. */
prvPrepareLinkLayerIPLookUp( pxEndPoint );

/* Setting an IP address manually so set to not using
* leased address mode. */
EP_DHCPData.eDHCPState = eGetLinkLayerAddress;
}
{
/* Only use a fake Ack if the default IP address == 0x00
* and the link local addressing is used. Start searching
* a free LinkLayer IP-address. Next state will be
* 'eGetLinkLayerAddress'. */
prvPrepareLinkLayerIPLookUp( pxEndPoint );

/* Setting an IP address manually so set to not using
* leased address mode. */
EP_DHCPData.eDHCPState = eGetLinkLayerAddress;
}
#else
{
xGivingUp = pdTRUE;
}
{
xGivingUp = pdTRUE;
}
#endif /* ipconfigDHCP_FALL_BACK_AUTO_IP */
}
}
Expand Down Expand Up @@ -1432,31 +1432,31 @@
( void ) memcpy( &( pucUDPPayloadBuffer[ dhcpFIRST_OPTION_BYTE_OFFSET ] ), pucOptionsArray, *pxOptionsArraySize );

#if ( ipconfigDHCP_REGISTER_HOSTNAME == 1 )
{
/* With this option, the hostname can be registered as well which makes
* it easier to lookup a device in a router's list of DHCP clients. */

/* Point to where the OPTION_END was stored to add data. */
pucPtr = &( pucUDPPayloadBuffer[ dhcpFIRST_OPTION_BYTE_OFFSET + ( *pxOptionsArraySize - 1U ) ] );
pucPtr[ 0U ] = dhcpIPv4_DNS_HOSTNAME_OPTIONS_CODE;
pucPtr[ 1U ] = ( uint8_t ) uxNameLength;

/*
* Use helper variables for memcpy() to remain
* compliant with MISRA Rule 21.15. These should be
* optimized away.
*/
if( pucHostName != NULL )
{
pvCopySource = pucHostName;
pvCopyDest = &pucPtr[ 2U ];
/* With this option, the hostname can be registered as well which makes
* it easier to lookup a device in a router's list of DHCP clients. */

/* Point to where the OPTION_END was stored to add data. */
pucPtr = &( pucUDPPayloadBuffer[ dhcpFIRST_OPTION_BYTE_OFFSET + ( *pxOptionsArraySize - 1U ) ] );
pucPtr[ 0U ] = dhcpIPv4_DNS_HOSTNAME_OPTIONS_CODE;
pucPtr[ 1U ] = ( uint8_t ) uxNameLength;

/*
* Use helper variables for memcpy() to remain
* compliant with MISRA Rule 21.15. These should be
* optimized away.
*/
if( pucHostName != NULL )
{
pvCopySource = pucHostName;
pvCopyDest = &pucPtr[ 2U ];

( void ) memcpy( pvCopyDest, pvCopySource, uxNameLength );
}
( void ) memcpy( pvCopyDest, pvCopySource, uxNameLength );
}

pucPtr[ 2U + uxNameLength ] = ( uint8_t ) dhcpOPTION_END_BYTE;
*pxOptionsArraySize += ( size_t ) ( 2U + uxNameLength );
}
pucPtr[ 2U + uxNameLength ] = ( uint8_t ) dhcpOPTION_END_BYTE;
*pxOptionsArraySize += ( size_t ) ( 2U + uxNameLength );
}
#endif /* if ( ipconfigDHCP_REGISTER_HOSTNAME == 1 ) */

/* Map in the client identifier. */
Expand Down
14 changes: 7 additions & 7 deletions source/FreeRTOS_DHCPv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -773,15 +773,15 @@ static void vDHCPv6ProcessEndPoint( BaseType_t xReset,
else
{
#if ( ipconfigHAS_DEBUG_PRINTF == 1 )
{
static eDHCPState_t lastState = eNotUsingLeasedAddress;

if( lastState != EP_DHCPData.eDHCPState )
{
lastState = EP_DHCPData.eDHCPState;
FreeRTOS_debug_printf( ( "vDHCPv6ProcessEndPoint: enter %s (%d)\n", prvStateName( EP_DHCPData.eDHCPState ), EP_DHCPData.eDHCPState ) );
static eDHCPState_t lastState = eNotUsingLeasedAddress;

if( lastState != EP_DHCPData.eDHCPState )
{
lastState = EP_DHCPData.eDHCPState;
FreeRTOS_debug_printf( ( "vDHCPv6ProcessEndPoint: enter %s (%d)\n", prvStateName( EP_DHCPData.eDHCPState ), EP_DHCPData.eDHCPState ) );
}
}
}
#endif /* ( ipconfigHAS_DEBUG_PRINTF == 1 ) */

xGivingUp = xDHCPv6ProcessEndPoint_HandleState( pxEndPoint, pxDHCPMessage );
Expand Down
Loading

0 comments on commit 6fc5569

Please sign in to comment.