]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Update the code to parse dhcpv6 lease files to accept a semi-colon at
authorShawn Routhier <sar@isc.org>
Wed, 13 Oct 2010 22:34:45 +0000 (22:34 +0000)
committerShawn Routhier <sar@isc.org>
Wed, 13 Oct 2010 22:34:45 +0000 (22:34 +0000)
the end of the max-life and preferred-life clauses.  In order to be
backwards compatible with older lease files not finding a semi-colon
is also accepted.  [ISC-Bugs #22303].

RELNOTES
server/confpars.c

index 488387ebf956c324f6188d5822d55fd0f5d4a96a..2404375a6d1358f9e4b7ead820017a4732f97ebb 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -114,6 +114,11 @@ work on other platforms. Please report any problems and suggested fixes to
   [ISC-Bugs #20952] Add 64 bit types to configure.ac
   [ISC-Bugs #21308] Add "PATH=" to CLIENT_PATH envrionment variable
 
+- Update the code to parse dhcpv6 lease files to accept a semi-colon at
+  the end of the max-life and preferred-life clauses.  In order to be
+  backwards compatible with older lease files not finding a semi-colon
+  is also accepted.  [ISC-Bugs #22303].
+
                        Changes since 4.2.0rc1
 
 - Documentation cleanup covering multiple tickets
index e022acf8a7c31175c9816066100eb12b6a0bdd7a..8dd3f624cba362af5c1a3b10e28ab71a53baab15 100644 (file)
@@ -4299,6 +4299,21 @@ parse_ia_na_declaration(struct parse *cfile) {
                                        continue;
                                }
                                prefer = atoi (val);
+
+                               /*
+                                * Currently we peek for the semi-colon to 
+                                * allow processing of older lease files that
+                                * don't have the semi-colon.  Eventually we
+                                * should remove the peeking code.
+                                */
+                               token = peek_token(&val, NULL, cfile);
+                               if (token == SEMI) {
+                                       token = next_token(&val, NULL, cfile);
+                               } else {
+                                       parse_warn(cfile,
+                                                  "corrupt lease file; "
+                                                  "expecting semicolon.");
+                               }
                                break;
 
                                /* Lease valid lifetime. */
@@ -4312,6 +4327,21 @@ parse_ia_na_declaration(struct parse *cfile) {
                                        continue;
                                }
                                valid = atoi (val);
+
+                               /*
+                                * Currently we peek for the semi-colon to 
+                                * allow processing of older lease files that
+                                * don't have the semi-colon.  Eventually we
+                                * should remove the peeking code.
+                                */
+                               token = peek_token(&val, NULL, cfile);
+                               if (token == SEMI) {
+                                       token = next_token(&val, NULL, cfile);
+                               } else {
+                                       parse_warn(cfile,
+                                                  "corrupt lease file; "
+                                                  "expecting semicolon.");
+                               }
                                break;
 
                                /* Lease expiration time. */
@@ -4632,6 +4662,21 @@ parse_ia_ta_declaration(struct parse *cfile) {
                                        continue;
                                }
                                prefer = atoi (val);
+
+                               /*
+                                * Currently we peek for the semi-colon to 
+                                * allow processing of older lease files that
+                                * don't have the semi-colon.  Eventually we
+                                * should remove the peeking code.
+                                */
+                               token = peek_token(&val, NULL, cfile);
+                               if (token == SEMI) {
+                                       token = next_token(&val, NULL, cfile);
+                               } else {
+                                       parse_warn(cfile,
+                                                  "corrupt lease file; "
+                                                  "expecting semicolon.");
+                               }
                                break;
 
                                /* Lease valid lifetime. */
@@ -4645,6 +4690,21 @@ parse_ia_ta_declaration(struct parse *cfile) {
                                        continue;
                                }
                                valid = atoi (val);
+
+                               /*
+                                * Currently we peek for the semi-colon to 
+                                * allow processing of older lease files that
+                                * don't have the semi-colon.  Eventually we
+                                * should remove the peeking code.
+                                */
+                               token = peek_token(&val, NULL, cfile);
+                               if (token == SEMI) {
+                                       token = next_token(&val, NULL, cfile);
+                               } else {
+                                       parse_warn(cfile,
+                                                  "corrupt lease file; "
+                                                  "expecting semicolon.");
+                               }
                                break;
 
                                /* Lease expiration time. */
@@ -4966,6 +5026,21 @@ parse_ia_pd_declaration(struct parse *cfile) {
                                        continue;
                                }
                                prefer = atoi (val);
+
+                               /*
+                                * Currently we peek for the semi-colon to 
+                                * allow processing of older lease files that
+                                * don't have the semi-colon.  Eventually we
+                                * should remove the peeking code.
+                                */
+                               token = peek_token(&val, NULL, cfile);
+                               if (token == SEMI) {
+                                       token = next_token(&val, NULL, cfile);
+                               } else {
+                                       parse_warn(cfile,
+                                                  "corrupt lease file; "
+                                                  "expecting semicolon.");
+                               }
                                break;
 
                                /* Lease valid lifetime. */
@@ -4979,6 +5054,21 @@ parse_ia_pd_declaration(struct parse *cfile) {
                                        continue;
                                }
                                valid = atoi (val);
+
+                               /*
+                                * Currently we peek for the semi-colon to 
+                                * allow processing of older lease files that
+                                * don't have the semi-colon.  Eventually we
+                                * should remove the peeking code.
+                                */
+                               token = peek_token(&val, NULL, cfile);
+                               if (token == SEMI) {
+                                       token = next_token(&val, NULL, cfile);
+                               } else {
+                                       parse_warn(cfile,
+                                                  "corrupt lease file; "
+                                                  "expecting semicolon.");
+                               }
                                break;
 
                                /* Prefix expiration time. */