summaryrefslogtreecommitdiff
path: root/lib/libpcap
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libpcap')
-rw-r--r--lib/libpcap/scanner.l15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/libpcap/scanner.l b/lib/libpcap/scanner.l
index 55828db9983..8f3a7d0f7cc 100644
--- a/lib/libpcap/scanner.l
+++ b/lib/libpcap/scanner.l
@@ -1,8 +1,8 @@
%{
-/* $OpenBSD: scanner.l,v 1.5 1996/07/12 13:19:13 mickey Exp $ */
+/* $OpenBSD: scanner.l,v 1.6 1997/07/22 07:42:32 deraadt Exp $ */
/*
- * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996
+ * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -24,7 +24,7 @@
#ifndef lint
static char rcsid[] =
- "@(#) $Header: /cvs/OpenBSD/src/lib/libpcap/scanner.l,v 1.5 1996/07/12 13:19:13 mickey Exp $ (LBL)";
+ "@(#) $Header: /cvs/OpenBSD/src/lib/libpcap/scanner.l,v 1.6 1997/07/22 07:42:32 deraadt Exp $ (LBL)";
#endif
#include <sys/types.h>
@@ -129,14 +129,15 @@ outbound return OUTBOUND;
">>" return RSH;
{N} { yylval.i = stoi((char *)yytext); return NUM; }
({N}\.{N})|({N}\.{N}\.{N})|({N}\.{N}\.{N}\.{N}) {
- yylval.s = sdup((char *)yytext); return HID;
-}
+ yylval.s = sdup((char *)yytext); return HID; }
{B}:{B}:{B}:{B}:{B}:{B} { yylval.e = pcap_ether_aton((char *)yytext);
return EID; }
{B}:+({B}:+)+ { bpf_error("bogus ethernet address %s", yytext); }
-[A-Za-z][-_.A-Za-z0-9]* { yylval.s = sdup((char *)yytext); return ID; }
+[A-Za-z0-9][-_.A-Za-z0-9]*[.A-Za-z0-9] {
+ yylval.s = sdup((char *)yytext); return ID; }
"\\"[^ !()\n\t]+ { yylval.s = sdup((char *)yytext + 1); return ID; }
-[^ \[\]\t\n\-_.A-Za-z0-9!<>()&|=]+ { bpf_error("illegal token: %s\n", yytext); }
+[^ \[\]\t\n\-_.A-Za-z0-9!<>()&|=]+i {
+ bpf_error("illegal token: %s\n", yytext); }
. { bpf_error("illegal char '%c'", *yytext); }
%%
void