From 63e530e2975821e84491cb99266a83596b8af3d0 Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Mon, 19 Oct 2015 11:29:49 +0200 Subject: [PATCH] config: count the interfaces as they are added. This information is useful to the various clock types. Signed-off-by: Richard Cochran --- config.c | 2 ++ config.h | 1 + 2 files changed, 3 insertions(+) diff --git a/config.c b/config.c index 7bb3b05..80fa255 100644 --- a/config.c +++ b/config.c @@ -607,6 +607,8 @@ struct interface *config_create_interface(char *name, struct config *cfg) strncpy(iface->name, name, MAX_IFNAME_SIZE); sk_get_ts_info(iface->name, &iface->ts_info); STAILQ_INSERT_TAIL(&cfg->interfaces, iface, list); + cfg->n_interfaces++; + return iface; } diff --git a/config.h b/config.h index ad057e9..b02bde6 100644 --- a/config.h +++ b/config.h @@ -41,6 +41,7 @@ struct interface { struct config { /* configured interfaces */ STAILQ_HEAD(interfaces_head, interface) interfaces; + int n_interfaces; /* hash of all non-legacy items */ struct hash *htab;