From patchwork Tue Jan 6 22:40:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Barth X-Patchwork-Id: 425866 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 9D803140077 for ; Wed, 7 Jan 2015 09:41:08 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752104AbbAFWlE (ORCPT ); Tue, 6 Jan 2015 17:41:04 -0500 Received: from mail.core-networks.de ([82.96.72.7]:39869 "EHLO mail.core-networks.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752081AbbAFWlD (ORCPT ); Tue, 6 Jan 2015 17:41:03 -0500 Received: from localhost ([127.0.0.1]) by mail.core-networks.de id 1Y8co9-00069w-Cx with ESMTPSA (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) for ; Tue, 06 Jan 2015 23:41:01 +0100 Received: from localhost.localdomain (unknown [IPv6:2001:470:52f9:0:fef8:aeff:fe3f:44b3]) by lan.midlink.org (Postfix) with ESMTPSA id B05887FC99; Tue, 6 Jan 2015 23:41:53 +0100 (CET) From: Steven Barth To: netfilter-devel@vger.kernel.org Cc: Steven Barth Subject: [PATCH 1/4] parser: rename VERSION token to HDRVERSION Date: Tue, 6 Jan 2015 23:40:22 +0100 Message-Id: <1420584025-7817-2-git-send-email-cyrus@openwrt.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1420584025-7817-1-git-send-email-cyrus@openwrt.org> References: <1420584025-7817-1-git-send-email-cyrus@openwrt.org> Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org A token name of VERSION results in a macro being defined with the same name. This prevents inclusion of config.h in commonly used headers. Signed-off-by: Steven Barth --- src/parser_bison.y | 6 +++--- src/scanner.l | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/parser_bison.y b/src/parser_bison.y index 3059d59..b20f4de 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -238,7 +238,7 @@ static void location_update(struct location *loc, struct location *rhs, int n) %token OPERATION "operation" %token IP "ip" -%token VERSION "version" +%token HDRVERSION "version" %token HDRLENGTH "hdrlength" %token TOS "tos" %token LENGTH "length" @@ -1966,7 +1966,7 @@ ip_hdr_expr : IP ip_hdr_field } ; -ip_hdr_field : VERSION { $$ = IPHDR_VERSION; } +ip_hdr_field : HDRVERSION { $$ = IPHDR_VERSION; } | HDRLENGTH { $$ = IPHDR_HDRLENGTH; } | TOS { $$ = IPHDR_TOS; } | LENGTH { $$ = IPHDR_LENGTH; } @@ -2013,7 +2013,7 @@ ip6_hdr_expr : IP6 ip6_hdr_field } ; -ip6_hdr_field : VERSION { $$ = IP6HDR_VERSION; } +ip6_hdr_field : HDRVERSION { $$ = IP6HDR_VERSION; } | PRIORITY { $$ = IP6HDR_PRIORITY; } | FLOWLABEL { $$ = IP6HDR_FLOWLABEL; } | LENGTH { $$ = IP6HDR_LENGTH; } diff --git a/src/scanner.l b/src/scanner.l index ed87da6..52b0078 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -349,7 +349,7 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr}) "operation" { return OPERATION; } "ip" { return IP; } -"version" { return VERSION; } +"version" { return HDRVERSION; } "hdrlength" { return HDRLENGTH; } "tos" { return TOS; } "length" { return LENGTH; }