Remove silly cache thingy.
[tinc] / src / subnet.c
index 5fdc045..5e09625 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: subnet.c,v 1.1.2.30 2002/02/18 16:25:19 guus Exp $
+    $Id: subnet.c,v 1.1.2.33 2002/03/12 14:20:44 guus Exp $
 */
 
 #include "config.h"
@@ -218,7 +218,7 @@ cp
       subnet->type = SUBNET_IPV6;
       subnet->net.ipv6.masklength = 128;
       for(i = 0; i < 8; i++)
-      subnet->net.ipv6.address.x[i] = htons(x[i]);
+        subnet->net.ipv6.address.x[i] = htons(x[i]);
       return subnet;
     }
 
@@ -318,7 +318,10 @@ cp
     if(p)
       {
        if(p->type != SUBNET_IPV4)
-         return NULL;
+         {
+           p = NULL;
+           break;
+         }
 
         if (!maskcmp((char *)address, (char *)&p->net.ipv4.address, p->net.ipv4.masklength, sizeof(ipv4_t)))
           break;
@@ -330,9 +333,9 @@ cp
             maskcpy((char *)&subnet.net.ipv4.address, (char *)&p->net.ipv4.address, subnet.net.ipv4.masklength, sizeof(ipv4_t));
           }
       }
-   } while (p);
-   
-   return p;
+  } while (p);
+cp
+  return p;
 }
 
 subnet_t *lookup_subnet_ipv6(ipv6_t *address)
@@ -368,7 +371,7 @@ cp
           }
       }
    } while (p);
-
+cp   
   return p;
 }