Modules/IPStack - Fixed NULL dereference in routing
authorJohn Hodge (sonata) <[email protected]>
Tue, 29 Jan 2013 11:40:28 +0000 (19:40 +0800)
committerJohn Hodge (sonata) <[email protected]>
Tue, 29 Jan 2013 11:40:28 +0000 (19:40 +0800)
KernelLand/Modules/IPStack/routing.c
KernelLand/Modules/IPStack/tcp.c

index d9efa99..e86f333 100644 (file)
@@ -115,12 +115,13 @@ tVFS_Node *IPStack_RouteDir_FindDir(tVFS_Node *Node, const char *Name)
                {       
                        LOG("Why does this route not have a node? trying to find an iface for the next hop");
 
-                       rt = _Route_FindInterfaceRoute(type, rt->NextHop);
-                       if(!rt) {
+                       void *nextrt = _Route_FindInterfaceRoute(type, rt->NextHop);
+                       if(!nextrt) {
                                Log_Notice("Cannot find route to next hop '%s'",
                                        IPStack_PrintAddress(type, rt->NextHop));
                                return NULL;
                        }
+                       rt = nextrt;
                }
                if( !rt->Interface ) {
                        Log_Notice("Routes", "No interface for route %p, what the?", rt);
index 8b4f99d..f1eee65 100644 (file)
@@ -1354,7 +1354,8 @@ void TCP_Client_Close(tVFS_Node *Node)
                while( conn->State == TCP_ST_FIN_WAIT1 )        Threads_Yield();
                break;
        default:
-               Log_Warning("TCP", "Unhandled connection state in TCP_Client_Close");
+               Log_Warning("TCP", "Unhandled connection state %i in TCP_Client_Close",
+                       conn->State);
                break;
        }
        

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