From 5cd19c526f39e4c098b879b2eaddd3fa1d4ab070 Mon Sep 17 00:00:00 2001 From: richardbarry 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. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1614 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- 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 071e4bfab..881beb7ea 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; -- 2.39.5