summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal/pol
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2017-03-02 15:16:32 +0000
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2017-03-02 15:16:32 +0000
commit46c2f9d5363cdff2d99cf1b1c4a41c5bf97d2c03 (patch)
tree7c4931890ee54d9bac331ac6031f411ddac08527 /src/ipcpd/normal/pol
parenta5796c7f02570a2878f9c6a5d28dca80beabed12 (diff)
parent9d2fbef7b8569aac930c95ca1afb92a5dec79dac (diff)
downloadouroboros-46c2f9d5363cdff2d99cf1b1c4a41c5bf97d2c03.tar.gz
ouroboros-46c2f9d5363cdff2d99cf1b1c4a41c5bf97d2c03.zip
Merged in sandervrijders/ouroboros/be-aes (pull request #395)
ipcpd: normal: Add connection manager
Diffstat (limited to 'src/ipcpd/normal/pol')
-rw-r--r--src/ipcpd/normal/pol/complete.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/ipcpd/normal/pol/complete.c b/src/ipcpd/normal/pol/complete.c
index 68f43e81..daf8c9bf 100644
--- a/src/ipcpd/normal/pol/complete.c
+++ b/src/ipcpd/normal/pol/complete.c
@@ -38,7 +38,7 @@
struct neighbor {
struct list_head next;
- char * neighbor;
+ uint64_t neighbor;
};
struct complete {
@@ -135,7 +135,6 @@ void complete_destroy(void * o)
list_for_each_safe(p, n, &complete->neighbors) {
struct neighbor * e = list_entry(p, struct neighbor, next);
list_del(&e->next);
- free(e->neighbor);
free(e);
}
@@ -168,7 +167,7 @@ int complete_accept_flow(void * o,
list_for_each(pos, &complete->neighbors) {
struct neighbor * e = list_entry(pos, struct neighbor, next);
/* FIXME: figure out union type and check name or address */
- if (strcmp(e->neighbor, info->ae.name) == 0) {
+ if (e->neighbor == info->addr) {
pthread_mutex_unlock(&complete->neighbors_lock);
return -1;
}
@@ -186,13 +185,7 @@ int complete_accept_flow(void * o,
list_head_init(&n->next);
- /* FIXME: figure out union type and check name or address */
- n->neighbor = strdup(info->ae.name);
- if (n->neighbor == NULL) {
- pthread_mutex_unlock(&complete->neighbors_lock);
- free(n);
- return -1;
- }
+ n->neighbor = info->addr;
list_add(&n->next, &complete->neighbors);