Skip to content

Commit e7cfcac

Browse files
author
Emil Popov
committed
Fixes IPv6 loopback type detection
1 parent fbb668a commit e7cfcac

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

source/FreeRTOS_Routing.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,18 +1429,22 @@ struct xIPv6_Couple
14291429

14301430
if( xIPCouples[ xIndex ].eType == eIPv6_Loopback )
14311431
{
1432+
/* Checking for the loopback address requires an explicit full-length test */
14321433
if( xIsIPv6Loopback( pxAddress ) != pdFALSE )
14331434
{
14341435
eResult = eIPv6_Loopback;
14351436
break;
14361437
}
14371438
}
1438-
1439-
if( ( usAddress & xIPCouples[ xIndex ].usMask ) == xIPCouples[ xIndex ].usExpected )
1439+
else if( ( usAddress & xIPCouples[ xIndex ].usMask ) == xIPCouples[ xIndex ].usExpected )
14401440
{
14411441
eResult = xIPCouples[ xIndex ].eType;
14421442
break;
14431443
}
1444+
else
1445+
{
1446+
/* Keep on checking... */
1447+
}
14441448
}
14451449
}
14461450

0 commit comments

Comments
 (0)