IPStack - Misc logging changes
authorJohn Hodge <[email protected]>
Mon, 30 May 2011 12:26:43 +0000 (20:26 +0800)
committerJohn Hodge <[email protected]>
Mon, 30 May 2011 12:26:43 +0000 (20:26 +0800)
Modules/IPStack/interface.c
Modules/IPStack/udp.c

index 6538078..ab458b6 100644 (file)
@@ -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 );
index ad34f85..1fce3ac 100644 (file)
@@ -263,7 +263,7 @@ static const char *casIOCtls_Channel[] = {
        DRV_IOCTLNAMES,
        "getset_localport",
        "getset_remoteport",
-       "set_remotemask",
+       "getset_remotemask",
        "set_remoteaddr",
        NULL
        };

UCC git Repository :: git.ucc.asn.au