pmlag

Poor man's link aggregation
git clone git://git.finwo.net/app/pmlag
Log | Files | Refs | README | LICENSE

commit 1a2487e42ba630fc2efaecef9cf651fe38a7d81c
parent 4bb71722241bba47b8369dbb8dcb585c87f3b577
Author: Robin Bron <robin@finwo.nl>
Date:   Mon, 27 Feb 2023 22:37:21 +0100

Added debug prints to rt

Diffstat:
Msrc/util/routing-table.c | 9++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/util/routing-table.c b/src/util/routing-table.c @@ -1,4 +1,5 @@ #include <linux/if_ether.h> +#include <stdio.h> #include <stdlib.h> #include <string.h> @@ -26,6 +27,8 @@ int rt_upsert( int isnew = 0; struct pmlag_rt_entry *rt_entry; + printf("\nUpserting RT\n"); + // Lock the routing table pthread_mutex_lock(mtx); @@ -45,6 +48,7 @@ int rt_upsert( (!bcidx && rt_entry->bcidx) || // We receive a regular packet on bcidx-tracked entry ((bcidx - rt_entry->bcidx) < 0) // Or the received bcidx is lower than known (old packet) ) { + printf(" Bail\n\n"); pthread_mutex_unlock(&(iface->bond->mtx_rt)); return 0; } @@ -75,9 +79,12 @@ int rt_upsert( // Save rt entry in the routing table if it's new // A pre-existing one is already stored (btree holds pointers, no need to re-save) if (isnew) { - btree_set(iface->bond->rt, rt_entry); + printf(" New MAC\n"); + btree_set(rt, rt_entry); } + printf(" RT is now %ld\n\n", btree_count(rt)); + pthread_mutex_unlock(mtx); return 0; }