- {
- if((p->nexthop == cl) && (p != cl))
- {
- if(cl->status.active && p->status.active)
-/* FIXME: reprogram this
- notify_others(p,cl,send_del_host);
-*/;
- if(cl->socket)
- close(cl->socket);
- p->status.active = 0;
- p->status.remove = 1;
- }
- }
-
+ if((p->nexthop == cl) && (p != cl))
+ terminate_connection(p); /* Sounds like recursion, but p does not have a meta connection :) */
+
+ /* Inform others of termination if it was still active */
+
+ if(cl->status.active)
+ for(p = conn_list; p != NULL; p = p->next)
+ if(p->status.meta && p->status.active && p!=cl)
+ send_del_host(p, cl);
+
+ /* Remove the associated subnets */
+
+ for(s = cl->subnets; s; s = s->next)
+ subnet_del(s);
+
+ /* Inactivate */
+