From: John Hodge Date: Mon, 30 May 2011 12:26:43 +0000 (+0800) Subject: IPStack - Misc logging changes X-Git-Tag: rel0.10~94 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=06f8392897b1001c41fcfa3e3fd5db4ca5b77258;p=tpg%2Facess2.git IPStack - Misc logging changes --- diff --git a/Modules/IPStack/interface.c b/Modules/IPStack/interface.c index 65380783..ab458b6b 100644 --- a/Modules/IPStack/interface.c +++ b/Modules/IPStack/interface.c @@ -238,6 +238,7 @@ tInterface *IPStack_AddInterface(const char *Device, const char *Name) + IPStack_GetAddressSize(-1)*3 // Address, Route->Network, Route->NextHop ); if(!iface) { + Log_Warning("IPStack", "AddInterface - malloc() failed"); LEAVE('n'); return NULL; // Return ERR_MYBAD } @@ -266,12 +267,7 @@ tInterface *IPStack_AddInterface(const char *Device, const char *Name) iface->TimeoutDelay = DEFAULT_TIMEOUT; // Get adapter handle - iface->Adapter = IPStack_GetAdapter(Device); - if( !iface->Adapter ) { - free( iface ); - LEAVE('n'); - return NULL; // Return ERR_YOUFAIL - } + iface->Adapter = card; // Delay setting ImplInt until after the adapter is opened // Keeps things simple @@ -554,6 +550,7 @@ tAdapter *IPStack_GetAdapter(const char *Path) // Ok, so let's open it dev = malloc( sizeof(tAdapter) + strlen(Path) + 1 ); if(!dev) { + Log_Warning("IPStack", "GetAdapter - malloc() failed"); Mutex_Release( &glIP_Adapters ); LEAVE('n'); return NULL; @@ -577,7 +574,7 @@ tAdapter *IPStack_GetAdapter(const char *Path) tmp = VFS_IOCtl(dev->DeviceFD, 0, NULL); LOG("Device type = %i", tmp); if( tmp != DRV_TYPE_NETWORK ) { - Warning("IPStack_GetAdapter: '%s' is not a network interface", dev->Device); + Log_Warning("IPStack", "IPStack_GetAdapter: '%s' is not a network interface", dev->Device); VFS_Close( dev->DeviceFD ); free( dev ); Mutex_Release( &glIP_Adapters ); diff --git a/Modules/IPStack/udp.c b/Modules/IPStack/udp.c index ad34f856..1fce3ac2 100644 --- a/Modules/IPStack/udp.c +++ b/Modules/IPStack/udp.c @@ -263,7 +263,7 @@ static const char *casIOCtls_Channel[] = { DRV_IOCTLNAMES, "getset_localport", "getset_remoteport", - "set_remotemask", + "getset_remotemask", "set_remoteaddr", NULL };