]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Allow views w/ same name and different class to be added to view list.
authorMark Andrews <marka@isc.org>
Fri, 1 Dec 2000 23:27:43 +0000 (23:27 +0000)
committerMark Andrews <marka@isc.org>
Fri, 1 Dec 2000 23:27:43 +0000 (23:27 +0000)
Change view add failure result test from == ISC_R_EXISTS -> != ISC_R_SUCCESS.

lib/dns/config/confparser.y.dirty
lib/dns/config/confview.c
lib/dns/include/dns/confview.h

index 410d52cac4f716f834fd605296d842089c4ed93d..29ba756bcf11f4a39ed182118cd78b826e123d60 100644 (file)
@@ -33,7 +33,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: confparser.y.dirty,v 1.33 2000/12/01 09:03:41 marka Exp $ */
+/* $Id: confparser.y.dirty,v 1.34 2000/12/01 23:27:40 marka Exp $ */
 
 #include <config.h>
 
@@ -3693,7 +3693,7 @@ view_stmt: L_VIEW any_string optional_class L_LBRACE
                }
 
                tmpres = dns_c_viewtable_addview(currcfg->views, view);
-               if (tmpres == ISC_R_EXISTS) {
+               if (tmpres != ISC_R_SUCCESS) {
                        dns_c_view_delete(&view);
                        parser_error(ISC_FALSE,
                                     "view '%s' already exists", $2);
index 2c1630b1f884a8c5e19150c5c5e26b7e6432d425..7e6df8098a5760c3a7b99fdbd9c3ceda07ab1efc 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: confview.c,v 1.61 2000/12/01 19:50:52 gson Exp $ */
+/* $Id: confview.c,v 1.62 2000/12/01 23:27:42 marka Exp $ */
 
 #include <config.h>
 
@@ -235,7 +235,7 @@ dns_c_viewtable_new(isc_mem_t *mem, dns_c_viewtable_t **viewtable) {
 }
 
 
-isc_result_t
+void
 dns_c_viewtable_delete(dns_c_viewtable_t **viewtable) {
        dns_c_viewtable_t *table;
 
@@ -249,8 +249,6 @@ dns_c_viewtable_delete(dns_c_viewtable_t **viewtable) {
 
        table->magic = 0;
        isc_mem_put(table->mem, table, sizeof *table);
-
-       return (ISC_R_SUCCESS);
 }
 
 
@@ -284,7 +282,8 @@ dns_c_viewtable_addview(dns_c_viewtable_t *viewtable, dns_c_view_t *view) {
 
        elem = ISC_LIST_HEAD(viewtable->views);
        while (elem != NULL) {
-               if (strcmp(view->name, elem->name) == 0) {
+               if (strcmp(view->name, elem->name) == 0 &&
+                   view->viewclass == elem->viewclass) {
                        return (ISC_R_EXISTS);
                }
 
@@ -307,7 +306,7 @@ dns_c_viewtable_rmview(dns_c_viewtable_t *viewtable, dns_c_view_t *view) {
 
 
 
-isc_result_t
+void
 dns_c_viewtable_clear(dns_c_viewtable_t *table) {
        dns_c_view_t *elem;
        dns_c_view_t *tmpelem;
@@ -322,8 +321,6 @@ dns_c_viewtable_clear(dns_c_viewtable_t *table) {
                dns_c_view_delete(&elem);
                elem = tmpelem;
        }
-
-       return (ISC_R_SUCCESS);
 }
 
 
index 4f2e54e3b95f21c3430205134b0672f352d96233..9d3a1b036a3038f857cc79772cf4f0bb8e7ead14 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: confview.h,v 1.45 2000/12/01 09:03:44 marka Exp $ */
+/* $Id: confview.h,v 1.46 2000/12/01 23:27:43 marka Exp $ */
 
 #ifndef DNS_CONFVIEW_H
 #define DNS_CONFVIEW_H 1
@@ -189,13 +189,13 @@ ISC_LANG_BEGINDECLS
 
 isc_result_t dns_c_viewtable_new(isc_mem_t *mem,
                                 dns_c_viewtable_t **viewtable);
-isc_result_t dns_c_viewtable_delete(dns_c_viewtable_t **viewtable);
+void dns_c_viewtable_delete(dns_c_viewtable_t **viewtable);
 
 void dns_c_viewtable_print(FILE *fp, int indent, dns_c_viewtable_t *table);
 isc_result_t dns_c_viewtable_addview(dns_c_viewtable_t *viewtable,
                                     dns_c_view_t *view);
 void dns_c_viewtable_rmview(dns_c_viewtable_t *viewtable, dns_c_view_t *view);
-isc_result_t dns_c_viewtable_clear(dns_c_viewtable_t *table);
+void dns_c_viewtable_clear(dns_c_viewtable_t *table);
 isc_result_t dns_c_viewtable_viewbyname(dns_c_viewtable_t *viewtable,
                                        const char *viewname,
                                        dns_c_view_t **retval);