summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Staessens <[email protected]>2018-10-19 01:02:33 +0200
committerSander Vrijders <[email protected]>2018-10-19 09:11:35 +0200
commit40102206f2406c686bb2253b96950084b9a4e6b9 (patch)
tree1db0b86b0e304de0d494a6430abcf00178dc9353
parent0dbfdabb2f6c3ad907421f90f90714315959339f (diff)
downloadouroboros-40102206f2406c686bb2253b96950084b9a4e6b9.tar.gz
ouroboros-40102206f2406c686bb2253b96950084b9a4e6b9.zip
ipcpd: Check if there are entries to add to pff
The pff didn't check if there were actually entries in the database, causing an assertion failure in some rare cases. Signed-off-by: Dimitri Staessens <[email protected]> Signed-off-by: Sander Vrijders <[email protected]>
-rw-r--r--src/ipcpd/normal/pol/link_state.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ipcpd/normal/pol/link_state.c b/src/ipcpd/normal/pol/link_state.c
index 5f592edf..d939e5dc 100644
--- a/src/ipcpd/normal/pol/link_state.c
+++ b/src/ipcpd/normal/pol/link_state.c
@@ -409,7 +409,7 @@ static void calculate_pff(struct routing_i * instance)
pff_flush(instance->pff);
- /* Calulcate forwarding table from routing table. */
+ /* Calculate forwarding table from routing table. */
list_for_each(p, &table) {
int i = 0;
struct routing_table * t =
@@ -424,8 +424,8 @@ static void calculate_pff(struct routing_i * instance)
fds[i++] = fd;
}
-
- pff_add(instance->pff, t->dst, fds, i);
+ if (i > 0)
+ pff_add(instance->pff, t->dst, fds, i);
}
pff_unlock(instance->pff);