projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Check for struct addrinfo
[tinc]
/
src
/
subnet.c
diff --git
a/src/subnet.c
b/src/subnet.c
index
99d97bc
..
1b7bc38
100644
(file)
--- 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.
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.2
7 2001/10/28 22:42:49
guus Exp $
+ $Id: subnet.c,v 1.1.2.2
8 2001/10/30 12:59:12
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-44,14
+44,8
@@
avl_tree_t *subnet_tree;
int subnet_compare_mac(subnet_t *a, subnet_t *b)
{
int subnet_compare_mac(subnet_t *a, subnet_t *b)
{
- int result;
cp
cp
- result = memcmp(&a->net.mac.address, &b->net.mac.address, sizeof(mac_t));
-
- if(result)
- return result;
-
- return strcmp(a->owner->name, b->owner->name);
+ return memcmp(&a->net.mac.address, &b->net.mac.address, sizeof(mac_t));
}
int subnet_compare_ipv4(subnet_t *a, subnet_t *b)
}
int subnet_compare_ipv4(subnet_t *a, subnet_t *b)
@@
-69,7
+63,7
@@
cp
else if(a->net.ipv4.mask > b->net.ipv4.mask)
return 1;
else if(a->net.ipv4.mask > b->net.ipv4.mask)
return 1;
- return
strcmp(a->owner->name, b->owner->name)
;
+ return
0
;
}
int subnet_compare_ipv6(subnet_t *a, subnet_t *b)
}
int subnet_compare_ipv6(subnet_t *a, subnet_t *b)
@@
-88,7
+82,7
@@
cp
if(result)
return result;
if(result)
return result;
- return
strcmp(a->owner->name, b->owner->name)
;
+ return
0
;
}
int subnet_compare(subnet_t *a, subnet_t *b)
}
int subnet_compare(subnet_t *a, subnet_t *b)
@@
-158,7
+152,7
@@
cp
free(subnet);
}
free(subnet);
}
-/*
Linked list management
*/
+/*
Adding and removing subnets
*/
void subnet_add(node_t *n, subnet_t *subnet)
{
void subnet_add(node_t *n, subnet_t *subnet)
{