From 40102206f2406c686bb2253b96950084b9a4e6b9 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Fri, 19 Oct 2018 01:02:33 +0200 Subject: 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 Signed-off-by: Sander Vrijders --- src/ipcpd/normal/pol/link_state.c | 6 +++--- 1 file 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); -- cgit v1.2.3