From af8e7f78af9b13c2cf6615dc9eb6c52c51b2bc2c Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sun, 16 Feb 2020 13:42:18 +0100 Subject: Add equal-cost multipath routing policy This adds an equal-cost multipath routing policy to Ouroboros, based on Nick Aerts' code. When selected, flows will send packets over all paths with equal cost (hop count). Path selection is round-robin. It does not yet take into account flows that are down. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/ipcpd/unicast/pol/alternate_pff.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/ipcpd/unicast/pol/alternate_pff.c') diff --git a/src/ipcpd/unicast/pol/alternate_pff.c b/src/ipcpd/unicast/pol/alternate_pff.c index 80c93f0e..f26bb047 100644 --- a/src/ipcpd/unicast/pol/alternate_pff.c +++ b/src/ipcpd/unicast/pol/alternate_pff.c @@ -27,13 +27,13 @@ #include #include +#include "pft.h" +#include "alternate_pff.h" + #include #include #include -#include "pft.h" -#include "alternate_pff.h" - struct nhop { struct list_head next; int fd; @@ -336,7 +336,7 @@ int alternate_flow_state_change(struct pff_i * pff_i, int fd, bool up) { - struct list_head * pos = NULL; + struct list_head * p; size_t len; int * fds; size_t i; @@ -358,8 +358,8 @@ int alternate_flow_state_change(struct pff_i * pff_i, } } - list_for_each(pos, &pff_i->addrs) { - struct addr * e = list_entry(pos, struct addr, next); + list_for_each(p, &pff_i->addrs) { + struct addr * e = list_entry(p, struct addr, next); if (pft_lookup(pff_i->pft, e->addr, &fds, &len)) { pthread_rwlock_unlock(&pff_i->lock); return -1; -- cgit v1.2.3