Source-Changes-HG archive

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

[src/trunk]: src/crypto/dist/ipsec-tools/src/setkey fix grammar stupidity: ip...



details:   https://anonhg.NetBSD.org/src/rev/5cd1e935e1b7
branches:  trunk
changeset: 802334:5cd1e935e1b7
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Sep 10 21:04:08 2014 +0000

description:
fix grammar stupidity: ipandport takes an optional port but has 2 grammar
productions, one with and one without an optional port. make the port
not optional and kill reduce-reduce conflicts.

diffstat:

 crypto/dist/ipsec-tools/src/setkey/parse.y |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (40 lines):

diff -r 86139d4c2de7 -r 5cd1e935e1b7 crypto/dist/ipsec-tools/src/setkey/parse.y
--- a/crypto/dist/ipsec-tools/src/setkey/parse.y        Wed Sep 10 21:01:33 2014 +0000
+++ b/crypto/dist/ipsec-tools/src/setkey/parse.y        Wed Sep 10 21:04:08 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.y,v 1.16 2013/10/20 21:17:28 christos Exp $      */
+/*     $NetBSD: parse.y,v 1.17 2014/09/10 21:04:08 christos Exp $      */
 
 /*     $KAME: parse.y,v 1.81 2003/07/01 04:01:48 itojun Exp $  */
 
@@ -141,7 +141,7 @@
 %type <num> PR_ESP PR_AH PR_IPCOMP PR_ESPUDP PR_TCP
 %type <num> EXTENSION MODE
 %type <ulnum> DECSTRING
-%type <val> PL_REQUESTS portstr key_string
+%type <val> PL_REQUESTS portstr portstr_notempty key_string
 %type <val> policy_requests
 %type <val> QUOTEDSTRING HEXSTRING STRING
 %type <val> F_AIFLAGS
@@ -772,7 +772,7 @@
                                return -1;
                        }
                }
-       |       STRING portstr
+       |       STRING portstr_notempty
                {
                        $$ = parse_addr($1.buf, $2.buf);
                        if ($$ == NULL) {
@@ -797,7 +797,11 @@
                        }
                        $$.len = strlen($$.buf);
                }
-       |       BLCL ANY ELCL
+       | portstr_notempty
+       ;
+
+portstr_notempty
+       :       BLCL ANY ELCL
                {
                        $$.buf = strdup("0");
                        if (!$$.buf) {



Home | Main Index | Thread Index | Old Index