From 9c25614cf4cf16056dd5aeca28811e53f2b74d2d Mon Sep 17 00:00:00 2001 From: Richard Barry Date: Mon, 26 Sep 2011 14:47:08 +0000 Subject: [PATCH] Add an assert in the Win32 lwIP port layer to catch invalid adapter numbers being used. --- Demo/Common/ethernet/lwip-1.4.0/ports/win32/ethernetif.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Demo/Common/ethernet/lwip-1.4.0/ports/win32/ethernetif.c b/Demo/Common/ethernet/lwip-1.4.0/ports/win32/ethernetif.c index 071e4bfab8..881beb7eab 100644 --- a/Demo/Common/ethernet/lwip-1.4.0/ports/win32/ethernetif.c +++ b/Demo/Common/ethernet/lwip-1.4.0/ports/win32/ethernetif.c @@ -453,6 +453,15 @@ struct xEthernetIf *pxEthernetIf; /* initialize the hardware */ prvLowLevelInit( pxNetIf ); + + /* Was an interface opened? */ + if( pxOpenedInterfaceHandle == NULL ) + { + /* Probably an invalid adapter number was defined in + FreeRTOSConfig.h. */ + xReturn = ERR_VAL; + configASSERT( pxOpenedInterfaceHandle ); + } } return xReturn;