Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/npf/npfctl npfctl: fix shift/reduce conflicts, than...
details: https://anonhg.NetBSD.org/src/rev/40f4132ab508
branches: trunk
changeset: 350774:40f4132ab508
user: rmind <rmind%NetBSD.org@localhost>
date: Fri Jan 20 23:00:30 2017 +0000
description:
npfctl: fix shift/reduce conflicts, thanks to riastradh@.
diffstat:
usr.sbin/npf/npfctl/npf_parse.y | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diffs (51 lines):
diff -r 0947cc90929d -r 40f4132ab508 usr.sbin/npf/npfctl/npf_parse.y
--- a/usr.sbin/npf/npfctl/npf_parse.y Fri Jan 20 22:10:38 2017 +0000
+++ b/usr.sbin/npf/npfctl/npf_parse.y Fri Jan 20 23:00:30 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: npf_parse.y,v 1.43 2017/01/20 03:16:40 kre Exp $ */
+/* $NetBSD: npf_parse.y,v 1.44 2017/01/20 23:00:30 rmind Exp $ */
/*-
* Copyright (c) 2011-2017 The NetBSD Foundation, Inc.
@@ -180,7 +180,7 @@
%type <var> element, list_elems, list, value
%type <addrport> mapseg
%type <filtopts> filt_opts, all_or_filt_opts
-%type <optproto> opt_proto
+%type <optproto> proto opt_proto
%type <rulegroup> group_opts
%type <tf> onoff
@@ -357,7 +357,11 @@
{
npfctl_build_natseg($3, $6, $2, &$5, &$7, &$9, &$10, $4);
}
- | MAP ifref map_sd map_algo opt_proto mapseg map_type mapseg
+ | MAP ifref map_sd map_algo mapseg map_type mapseg
+ {
+ npfctl_build_natseg($3, $6, $2, &$5, &$7, NULL, NULL, $4);
+ }
+ | MAP ifref map_sd map_algo proto mapseg map_type mapseg
{
npfctl_build_natseg($3, $7, $2, &$6, &$8, &$5, NULL, $4);
}
@@ -546,7 +550,7 @@
| { $$ = AF_UNSPEC; }
;
-opt_proto
+proto
: PROTO TCP tcp_flags_and_mask
{
$$.op_proto = IPPROTO_TCP;
@@ -572,6 +576,10 @@
$$.op_proto = $2;
$$.op_opts = NULL;
}
+ ;
+
+opt_proto
+ : proto { $$ = $1; }
|
{
$$.op_proto = -1;
Home |
Main Index |
Thread Index |
Old Index