Source-Changes-HG archive

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

[src/netbsd-1-6]: src/dist/dhcp/common Pull up revision 1.6 (requested by mel...



details:   https://anonhg.NetBSD.org/src/rev/9e06ca48870e
branches:  netbsd-1-6
changeset: 530996:9e06ca48870e
user:      tron <tron%NetBSD.org@localhost>
date:      Tue Oct 28 07:19:20 2003 +0000

description:
Pull up revision 1.6 (requested by mellon in ticket #1544):
- 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 bc78a6f95ee0 -r 9e06ca48870e dist/dhcp/common/parse.c
--- a/dist/dhcp/common/parse.c  Mon Oct 27 20:45:01 2003 +0000
+++ b/dist/dhcp/common/parse.c  Tue Oct 28 07:19:20 2003 +0000
@@ -43,7 +43,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: parse.c,v 1.2.4.3 2003/10/27 20:45:01 tron Exp $ Copyright (c) 1995-2002 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: parse.c,v 1.2.4.4 2003/10/28 07:19:20 tron 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