diff --git a/daemon/media_socket.c b/daemon/media_socket.c index a0af9021a..16aad237a 100644 --- a/daemon/media_socket.c +++ b/daemon/media_socket.c @@ -496,9 +496,8 @@ static int has_free_ports_log_all(struct logical_intf *log, unsigned int num_por } struct local_intf *loc; - GList *l; - for (l = log->list.head; l; l = l->next) { + for (__auto_type l = log->list.head; l; l = l->next) { loc = l->data; if (!has_free_ports_loc(loc, num_ports)) { @@ -804,7 +803,7 @@ static void __interface_append(struct intf_config *ifa, sockfamily_t *fam, bool return; lif = g_slice_alloc0(sizeof(*lif)); - g_queue_init(&lif->list); + t_queue_init(&lif->list); lif->name = ifa->name; lif->name_base = ifa->name_base; lif->preferred_family = fam; @@ -849,7 +848,7 @@ static void __interface_append(struct intf_config *ifa, sockfamily_t *fam, bool } } - ifc = uid_slice_alloc0(ifc, &lif->list); + ifc = uid_slice_alloc0(ifc, &lif->list.q); ice_foundation(&ifc->ice_foundation); ifc->advertised_address = ifa->advertised_address; ifc->spec = spec; @@ -925,7 +924,7 @@ void interfaces_exclude_port(unsigned int port) { } struct local_intf *get_interface_address(const struct logical_intf *lif, sockfamily_t *fam) { - const GQueue *q; + const local_intf_q *q; if (!fam) return NULL; @@ -1262,7 +1261,6 @@ fail: /* puts a list of "struct intf_list" into "out", containing socket_t list */ int get_consecutive_ports(socket_intf_list_q *out, unsigned int num_ports, unsigned int num_intfs, struct call_media *media) { - GList *l; struct socket_intf_list *il; struct local_intf *loc; const struct logical_intf *log = media->logical_intf; @@ -1279,7 +1277,7 @@ int get_consecutive_ports(socket_intf_list_q *out, unsigned int num_ports, unsig ilog(LOG_DEBUG, ""); */ - for (l = log->list.head; l; l = l->next) { + for (__auto_type l = log->list.head; l; l = l->next) { if (out->length >= num_intfs) break; @@ -3274,7 +3272,7 @@ void interfaces_free(void) { struct logical_intf *lif; while ((lif = g_queue_pop_head(q))) { g_hash_table_destroy(lif->rr_specs); - g_queue_clear(&lif->list); + t_queue_clear(&lif->list); g_slice_free1(sizeof(*lif), lif); } } diff --git a/daemon/redis.c b/daemon/redis.c index 0656563fd..c4c0d34c5 100644 --- a/daemon/redis.c +++ b/daemon/redis.c @@ -1416,7 +1416,7 @@ static int redis_sfds(call_t *c, struct redis_list *sfds) { if (!lif) goto err; err = "not enough local interfaces"; - loc = g_queue_peek_nth(&lif->list, loc_uid); + loc = t_queue_peek_nth(&lif->list, loc_uid); if (!loc) goto err; diff --git a/include/media_socket.h b/include/media_socket.h index b9b5e62b2..e6e080714 100644 --- a/include/media_socket.h +++ b/include/media_socket.h @@ -74,10 +74,12 @@ struct streamhandler { +TYPED_GQUEUE(local_intf, struct local_intf) + struct logical_intf { str name; sockfamily_t *preferred_family; - GQueue list; /* struct local_intf */ + local_intf_q list; GHashTable *rr_specs; str name_base; // if name is "foo:bar", this is "foo" };