[PATCH 1/2] ipcpd: Check if there are entries to add to pff

  • From: Dimitri Staessens <dimitri.staessens@xxxxxxxx>
  • To: ouroboros@xxxxxxxxxxxxx
  • Date: Fri, 19 Oct 2018 00:59:20 +0200

The

Signed-off-by: Dimitri Staessens <dimitri.staessens@xxxxxxxx>
---
 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 5f592ed..d939e5d 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);
-- 
2.19.1


Other related posts: