diff options
author | Sander Vrijders <sander.vrijders@ugent.be> | 2017-09-21 14:58:07 +0000 |
---|---|---|
committer | dimitri staessens <dimitri.staessens@ugent.be> | 2017-09-21 14:58:07 +0000 |
commit | e2d3b18ab787ebe090cd958cc63be655be86f42c (patch) | |
tree | a51f0260c4445ddf35fb190e605704669e84bb94 /src/ipcpd/normal/pol/simple_pff.c | |
parent | e5336f1309c42da770ef7aa603b463ad4d24e2c9 (diff) | |
parent | f6071ecf0cd3768eaed9a847f676433c120ea89e (diff) | |
download | ouroboros-e2d3b18ab787ebe090cd958cc63be655be86f42c.tar.gz ouroboros-e2d3b18ab787ebe090cd958cc63be655be86f42c.zip |
Merged in sandervrijders/ouroboros/be-lfa-pff (pull request #607)
ipcpd: normal: Add alternate hop PFF
Diffstat (limited to 'src/ipcpd/normal/pol/simple_pff.c')
-rw-r--r-- | src/ipcpd/normal/pol/simple_pff.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/ipcpd/normal/pol/simple_pff.c b/src/ipcpd/normal/pol/simple_pff.c index 28f7aa2e..7af4663c 100644 --- a/src/ipcpd/normal/pol/simple_pff.c +++ b/src/ipcpd/normal/pol/simple_pff.c @@ -109,7 +109,7 @@ int simple_pff_add(struct pff_i * pff_i, *val = fd[0]; - if (htable_insert(pff_i->table, addr, val)) { + if (htable_insert(pff_i->table, addr, val, 1)) { free(val); return -1; } @@ -137,7 +137,7 @@ int simple_pff_update(struct pff_i * pff_i, return -1; } - if (htable_insert(pff_i->table, addr, val)) { + if (htable_insert(pff_i->table, addr, val, 1)) { free(val); return -1; } @@ -166,16 +166,16 @@ void simple_pff_flush(struct pff_i * pff_i) int simple_pff_nhop(struct pff_i * pff_i, uint64_t addr) { - int * j; - int fd = -1; + void * j; + size_t len; + int fd = -1; assert(pff_i); pthread_rwlock_rdlock(&pff_i->lock); - j = (int *) htable_lookup(pff_i->table, addr); - if (j != NULL) - fd = *j; + if (!htable_lookup(pff_i->table, addr, &j, &len)) + fd = *((int *) j); pthread_rwlock_unlock(&pff_i->lock); |