chiark / gitweb /
Copyright dates fixed; various TODOs added.
[adns.git] / src / reply.c
index 6198d07dccb8a1c01844495fdf94d2ab9e67f332..c37bb4069683038b858fb99cd070f89f5c775472 100644 (file)
@@ -3,7 +3,7 @@
  * - main handling and parsing routine for received datagrams
  */
 /*
- *  This file is part of adns, which is Copyright (C) 1997, 1998 Ian Jackson
+ *  This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
  *  
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -157,7 +157,10 @@ void adns__procdgram(adns_state ads, const byte *dgram, int dglen,
     }
     if (rrtype == adns_r_cname && /* fixme - implement adns_qf_nocname */
        (qu->typei->type & adns__rrt_typemask) != adns_r_cname) {
-      if (!qu->cname_dgram) { /* Ignore second and subsequent CNAMEs */
+      if (qu->flags & adns_qf_cname_forbid) {
+       adns__query_fail(qu,adns_s_prohibitedcname);
+       return;
+      } else if (!qu->cname_dgram) { /* Ignore second and subsequent CNAMEs */
        qu->cname_begin= rdstart;
        qu->cname_dglen= dglen;
        st= adns__parse_domain(ads,serv,qu, &qu->vb,