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;