+static void age_subnets(int fd, short events, void *data) {
+ bool left = false;
+ time_t now = time(NULL);
+
+ for splay_each(subnet_t, s, myself->subnet_tree) {
+ if(s->expires && s->expires < now) {
+ if(debug_level >= DEBUG_TRAFFIC) {
+ char netstr[MAXNETSTR];
+ if(net2str(netstr, sizeof netstr, s))
+ logger(DEBUG_TRAFFIC, LOG_INFO, "Subnet %s expired", netstr);
+ }
+
+ for list_each(connection_t, c, connection_list)
+ if(c->status.active)
+ send_del_subnet(c, s);
+
+ subnet_del(myself, s);
+ } else {
+ if(s->expires)
+ left = true;
+ }
+ }