Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/dist/dhcp/common - Apply patches from ISC DHCP 3.0.1rc12 to ...



details:   https://anonhg.NetBSD.org/src/rev/db8e31a24d5f
branches:  trunk
changeset: 554397:db8e31a24d5f
user:      mellon <mellon%NetBSD.org@localhost>
date:      Mon Oct 27 20:16:09 2003 +0000

description:
- Apply patches from ISC DHCP 3.0.1rc12 to correct a parser bug that causes
  the ISC DHCP server to fail to start when it is configured to use the
  ad-hoc DNS update mechanism.   This fixes PR#20460 and PR#23284 (once
  this is pulled up to the 1.6 branch).

diffstat:

 dist/dhcp/common/parse.c |  26 ++++++++++++++++++--------
 1 files changed, 18 insertions(+), 8 deletions(-)

diffs (72 lines):

diff -r e6410436ea7e -r db8e31a24d5f dist/dhcp/common/parse.c
--- a/dist/dhcp/common/parse.c  Mon Oct 27 20:09:49 2003 +0000
+++ b/dist/dhcp/common/parse.c  Mon Oct 27 20:16:09 2003 +0000
@@ -43,7 +43,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: parse.c,v 1.5 2003/02/18 17:08:41 drochner Exp $ Copyright (c) 1995-2002 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: parse.c,v 1.6 2003/10/27 20:16:09 mellon Exp $ Copyright (c) 1995-2002 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -284,8 +284,11 @@
                name = parse_host_name (cfile);
                if (!name)
                        return 0;
-               if (!make_host_lookup (expr, name))
+               if (!make_host_lookup (expr, name)) {
+                       dfree(name, MDL);
                        return 0;
+               }
+               dfree(name, MDL);
                if (!uniform) {
                        if (!make_limit (&x, *expr, 4))
                                return 0;
@@ -4032,7 +4035,11 @@
        }
 
        if (binop != expr_none) {
-         if (expression_context (rhs) != expression_context (lhs)) {
+         rhs_context = expression_context(rhs);
+         lhs_context = expression_context(lhs);
+
+         if ((rhs_context != context_any) && (lhs_context != context_any) &&
+                       (rhs_context != lhs_context)) {
            parse_warn (cfile, "illegal expression relating different types");
            skip_to_semi (cfile);
            expression_dereference (&rhs, MDL);
@@ -4044,9 +4051,10 @@
          switch(binop) {
            case expr_not_equal:
            case expr_equal:
-               if ((expression_context(rhs) != context_data_or_numeric) &&
-                   (expression_context(rhs) != context_data) &&
-                   (expression_context(rhs) != context_numeric)) {
+               if ((rhs_context != context_data_or_numeric) &&
+                   (rhs_context != context_data) &&
+                   (rhs_context != context_numeric) &&
+                   (rhs_context != context_any)) {
                        parse_warn (cfile, "expecting data/numeric expression");
                        skip_to_semi (cfile);
                        expression_dereference (&rhs, MDL);
@@ -4057,7 +4065,8 @@
 
            case expr_and:
            case expr_or:
-               if (expression_context(rhs) != context_boolean) {
+               if ((rhs_context != context_boolean) &&
+                   (rhs_context != context_any)) {
                        parse_warn (cfile, "expecting boolean expressions");
                        skip_to_semi (cfile);
                        expression_dereference (&rhs, MDL);
@@ -4074,7 +4083,8 @@
            case expr_binary_and:
            case expr_binary_or:
            case expr_binary_xor:
-               if (expression_context(rhs) != context_numeric) {
+               if ((rhs_context != context_numeric) &&
+                   (rhs_context != context_any)) {
                        parse_warn (cfile, "expecting numeric expressions");
                         skip_to_semi (cfile);
                         expression_dereference (&rhs, MDL);



Home | Main Index | Thread Index | Old Index