From 0ae1f0dd600f6c21c34565cf4dc0c5ef0ae42709 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Wed, 12 Feb 2020 22:31:18 +0100 Subject: ipcpd: Configure PFF from routing policy The Packet Forwarding Function (PFF) was user-configurable using the irm tool. However, this isn't really wanted since the PFF is dictated by the routing algorithm. This moves the responsability for selecting the correct PFF from the network admin to the unicast IPCP implementation. Each routing policy now has to specify which PFF it will use. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/ipcpd/unicast/routing.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/ipcpd/unicast/routing.c') diff --git a/src/ipcpd/unicast/routing.c b/src/ipcpd/unicast/routing.c index 1d660cde..0794555e 100644 --- a/src/ipcpd/unicast/routing.c +++ b/src/ipcpd/unicast/routing.c @@ -24,6 +24,7 @@ #include +#include "pff.h" #include "routing.h" #include "pol/link_state.h" @@ -31,16 +32,25 @@ struct pol_routing_ops * r_ops; int routing_init(enum pol_routing pr) { + enum pol_pff pff_type; + switch (pr) { case ROUTING_LINK_STATE: + pff_type = PFF_SIMPLE; + r_ops = &link_state_ops; + break; case ROUTING_LINK_STATE_LFA: + pff_type = PFF_ALTERNATE; r_ops = &link_state_ops; break; default: return -ENOTSUP; } - return r_ops->init(pr); + if (r_ops->init(pr)) + return -1; + + return pff_type; } struct routing_i * routing_i_create(struct pff * pff) -- cgit v1.2.3