X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Modules%2FIPStack%2Finterface.c;h=e08d6505b2a747c312e22747755f6a066745548c;hb=cc9c4465db1c38904798f967019c863f5b552d5f;hp=ab458b6b6df63a0feee92b114b5eccaf90f9d6db;hpb=06f8392897b1001c41fcfa3e3fd5db4ca5b77258;p=tpg%2Facess2.git diff --git a/Modules/IPStack/interface.c b/Modules/IPStack/interface.c index ab458b6b..e08d6505 100644 --- a/Modules/IPStack/interface.c +++ b/Modules/IPStack/interface.c @@ -6,8 +6,8 @@ #define VERSION VER2(0,10) #include "ipstack.h" #include "link.h" -#include -#include +#include +#include // === CONSTANTS === //! Default timeout value, 30 seconds @@ -144,28 +144,6 @@ tVFS_Node *IPStack_Root_FindDir(tVFS_Node *Node, const char *Name) return &gIP_LoopInterface.Node; } - #if 0 - i = 0; num = 0; - while('0' <= Name[i] && Name[i] <= '9') - { - num *= 10; - num += Name[i] - '0'; - i ++; - } - if(Name[i] != '\0') { - LEAVE('n'); - return NULL; - } - - for( iface = gIP_Interfaces; iface; iface = iface->Next ) - { - if( (int)iface->Node.ImplInt == num ) - { - LEAVE('p', &iface->Node); - return &iface->Node; - } - } - #else for( iface = gIP_Interfaces; iface; iface = iface->Next ) { if( strcmp(iface->Name, Name) == 0 ) @@ -174,7 +152,6 @@ tVFS_Node *IPStack_Root_FindDir(tVFS_Node *Node, const char *Name) return &iface->Node; } } - #endif LEAVE('p', NULL); return NULL; @@ -204,6 +181,7 @@ int IPStack_Root_IOCtl(tVFS_Node *Node, int ID, void *Data) { char name[4] = ""; tInterface *iface = IPStack_AddInterface(Data, name); + if(iface == NULL) LEAVE_RET('i', -1); tmp = iface->Node.ImplInt; } LEAVE_RET('i', tmp); @@ -226,6 +204,7 @@ tInterface *IPStack_AddInterface(const char *Device, const char *Name) card = IPStack_GetAdapter(Device); if( !card ) { + Log_Debug("IPStack", "Unable to open card '%s'", Device); LEAVE('n'); return NULL; // ERR_YOURBAD }