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"
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;
}
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;
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)
}
}
} while (p);
-
+cp
return p;
}