X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fsubnet.c;h=5e096252b8f4806daefd823731d2c5b6306cd0bb;hp=5fdc045ae453dfe1d2697246630a8dc620d76c65;hb=ecad9e9289162faec7b678be54178d22876b5d90;hpb=c2b9c06062d36bde859b630b99a08c7b7428e721 diff --git a/src/subnet.c b/src/subnet.c index 5fdc045a..5e096252 100644 --- a/src/subnet.c +++ b/src/subnet.c @@ -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; }