]> jfr.im git - solanum.git/blobdiff - ircd/dns.c
free server_p->certfp, allocated in newconf.c
[solanum.git] / ircd / dns.c
index a3a8077e1f7a5a92cee6eabe9c37a15c3c892c2c..fa3c530a8b2a8983baad387274e792b4d6c09af0 100644 (file)
@@ -66,8 +66,15 @@ rb_dlink_list nameservers;
 static uint32_t query_id = 0;
 static uint32_t stat_id = 0;
 
-#define ASSIGN_ID(id) (id++)
 
+static inline uint32_t
+assign_id(uint32_t *id)
+{
+       if(++(*id) == 0)
+               *id = 1;
+
+       return *id;
+}
 
 static void
 handle_dns_failure(uint32_t xid)
@@ -122,7 +129,7 @@ lookup_hostname(const char *hostname, int aftype, DNSCB callback, void *data)
 {
        struct dnsreq *req = rb_malloc(sizeof(struct dnsreq));
        int aft;
-       uint32_t rid = ASSIGN_ID(query_id);
+       uint32_t rid = assign_id(&query_id);
 
        check_authd();
 
@@ -147,7 +154,7 @@ lookup_ip(const char *addr, int aftype, DNSCB callback, void *data)
 {
        struct dnsreq *req = rb_malloc(sizeof(struct dnsreq));
        int aft;
-       uint32_t rid = ASSIGN_ID(query_id);
+       uint32_t rid = assign_id(&query_id);
 
        check_authd();
 
@@ -167,11 +174,11 @@ lookup_ip(const char *addr, int aftype, DNSCB callback, void *data)
        return (rid);
 }
 
-uint32_t
+static uint32_t
 get_nameservers(DNSLISTCB callback, void *data)
 {
        struct dnsstatreq *req = rb_malloc(sizeof(struct dnsstatreq));
-       uint32_t qid = ASSIGN_ID(stat_id);
+       uint32_t qid = assign_id(&stat_id);
 
        check_authd();