X-Git-Url: https://git.distorted.org.uk/~mdw/secnet/blobdiff_plain/7908f2c6b5be419f8f4031876139953d4ee8340d..59230b9b9fc44453f24c6b3cf33a0f4c570a3563:/netlink.c diff --git a/netlink.c b/netlink.c index 76ac91c..f6d4e72 100644 --- a/netlink.c +++ b/netlink.c @@ -98,6 +98,8 @@ their use. */ #include +#include +#include #include "secnet.h" #include "util.h" #include "ipaddr.h" @@ -770,8 +772,10 @@ static void netlink_phase_hook(void *sst, uint32_t new_phase) "netlink_phase_hook"); /* Fill the table */ i=0; - for (c=st->clients; c; c=c->next) + for (c=st->clients; c; c=c->next) { + assert(iroutes[i++]=c; + } /* Sort the table in descending order of priority */ qsort(st->routes,st->n_clients,sizeof(*st->routes), netlink_compare_client_priority); @@ -911,6 +915,7 @@ static closure_t *netlink_inst_create(struct netlink *st, c->kup=False; c->next=st->clients; st->clients=c; + assert(st->n_clients < INT_MAX); st->n_clients++; return &c->cl;