commit 1b74382fa031e9493f16f2412d241b7920615471
parent 714b342390235b3fddc525ca28a271cf4ea91802
Author: Yersa Nordman <yersa@finwo.nl>
Date: Mon, 20 Mar 2023 22:49:06 +0100
Make the bond track how many interfaces it has
Diffstat:
2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/util/config.c b/src/util/config.c
@@ -71,6 +71,7 @@ static int config_load_handler(
iface_entry->data = calloc(1, sizeof(struct pmlag_iface));
iface_entry->data->name = strdup(value);
iface_entry->data->bond = bond;
+ bond->iface_cnt++;
}
} else if (!strcmp(name, "hwaddr")) {
diff --git a/src/util/config.h b/src/util/config.h
@@ -45,6 +45,7 @@ struct pmlag_bond {
pthread_mutex_t mtx_rt; // lock for the routing table of the bond
struct mindex_t *rt; // pointer to the routing table
pmlag_iface_llist *interfaces; // linked-list of interfaces contained in the bond
+ int iface_cnt; // track the number of interfaces in this bond
};
struct pmlag_configuration {