From f6071ecf0cd3768eaed9a847f676433c120ea89e Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Thu, 21 Sep 2017 14:26:51 +0200 Subject: ipcpd: normal: Add alternate hop PFF This adds a PFF that returns an alternate hop as next hop in case the hop that would have been returned is down. --- src/ipcpd/normal/pff.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/ipcpd/normal/pff.c') diff --git a/src/ipcpd/normal/pff.c b/src/ipcpd/normal/pff.c index 27ff17f7..3d114aa1 100644 --- a/src/ipcpd/normal/pff.c +++ b/src/ipcpd/normal/pff.c @@ -24,6 +24,7 @@ #include "pff.h" #include "pol-pff-ops.h" +#include "pol/alternate_pff.h" #include "pol/simple_pff.h" struct pff { @@ -40,16 +41,20 @@ struct pff * pff_create(enum pol_pff pol) return NULL; switch (pol) { - case SIMPLE_PFF: + case PFF_ALTERNATE: + pff->ops = &alternate_pff_ops; + break; + case PFF_SIMPLE: pff->ops = &simple_pff_ops; - pff->pff_i = pff->ops->create(); - if (pff->pff_i == NULL) - goto err; break; default: goto err; } + pff->pff_i = pff->ops->create(); + if (pff->pff_i == NULL) + goto err; + return pff; err: free(pff); -- cgit v1.2.3