summaryrefslogtreecommitdiff
path: root/lib/libpcap
diff options
context:
space:
mode:
authorDug Song <dugsong@cvs.openbsd.org>2000-06-29 06:56:14 +0000
committerDug Song <dugsong@cvs.openbsd.org>2000-06-29 06:56:14 +0000
commit031377ecf9464f4224fb08fdf02ee82a273d1d7e (patch)
tree63f4cf2443ec9ac7ca60632aade0112b1507c8be /lib/libpcap
parent199a738f694676dd22163d3d76251f95298169f1 (diff)
remove legacy over-general :{B} match for MAC addresses, fixing filters like 'arp[6:2] = 2'. ok angelos@
Diffstat (limited to 'lib/libpcap')
-rw-r--r--lib/libpcap/grammar.y8
-rw-r--r--lib/libpcap/scanner.l6
2 files changed, 5 insertions, 9 deletions
diff --git a/lib/libpcap/grammar.y b/lib/libpcap/grammar.y
index f188378473c..b598d285d27 100644
--- a/lib/libpcap/grammar.y
+++ b/lib/libpcap/grammar.y
@@ -1,5 +1,5 @@
%{
-/* $OpenBSD: grammar.y,v 1.7 2000/04/26 21:25:53 jakob Exp $ */
+/* $OpenBSD: grammar.y,v 1.8 2000/06/29 06:56:13 dugsong Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996
@@ -24,7 +24,7 @@
*/
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /cvs/OpenBSD/src/lib/libpcap/grammar.y,v 1.7 2000/04/26 21:25:53 jakob Exp $ (LBL)";
+ "@(#) $Header: /cvs/OpenBSD/src/lib/libpcap/grammar.y,v 1.8 2000/06/29 06:56:13 dugsong Exp $ (LBL)";
#endif
#include <sys/types.h>
@@ -110,14 +110,13 @@ pcap_parse()
%token NUM INBOUND OUTBOUND
%token LINK
%token GEQ LEQ NEQ
-%token ID EID HID HID6 AID
+%token ID EID HID HID6
%token LSH RSH
%token LEN
%token IPV6 ICMPV6 AH ESP
%type <s> ID
%type <e> EID
-%type <e> AID
%type <s> HID HID6
%type <i> NUM
@@ -189,7 +188,6 @@ nid: ID { $$.b = gen_scode($1, $$.q = $<blk>0.q); }
#endif /*INET6*/
}
| EID { $$.b = gen_ecode($1, $$.q = $<blk>0.q); }
- | AID { $$.b = gen_acode($1, $$.q = $<blk>0.q); }
| not id { gen_not($2.b); $$ = $2; }
;
not: '!' { $$ = $<blk>0; }
diff --git a/lib/libpcap/scanner.l b/lib/libpcap/scanner.l
index 01672e0c02a..77b7cdf6232 100644
--- a/lib/libpcap/scanner.l
+++ b/lib/libpcap/scanner.l
@@ -1,5 +1,5 @@
%{
-/* $OpenBSD: scanner.l,v 1.9 2000/04/26 21:25:53 jakob Exp $ */
+/* $OpenBSD: scanner.l,v 1.10 2000/06/29 06:56:13 dugsong Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -24,7 +24,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /cvs/OpenBSD/src/lib/libpcap/scanner.l,v 1.9 2000/04/26 21:25:53 jakob Exp $ (LBL)";
+ "@(#) $Header: /cvs/OpenBSD/src/lib/libpcap/scanner.l,v 1.10 2000/06/29 06:56:13 dugsong Exp $ (LBL)";
#endif
#include <sys/types.h>
@@ -233,8 +233,6 @@ outbound return OUTBOUND;
"==" return '=';
"<<" return LSH;
">>" return RSH;
-:{B} { yylval.e = pcap_ether_aton(((char *)yytext)+1);
- return AID; }
{N} { yylval.i = stoi((char *)yytext); return NUM; }
({N}\.{N})|({N}\.{N}\.{N})|({N}\.{N}\.{N}\.{N}) {
yylval.s = sdup((char *)yytext); return HID; }