summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-06-18 16:26:22 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-06-18 16:26:22 +0000
commit31de8d0feb20f35a4a3f5d4ffd92b0b51cd55dfb (patch)
tree1b47a95c6554709ba8e88191ea7ee3c5afdc12b9
parent5b9210134725c4a099ffacac330253c17a5b981a (diff)
libpcap used yyparse(), which is bad; netbsd pr#2031; lukem@supp.cpr.itg.telecom.com.au
-rw-r--r--lib/libpcap/Makefile13
-rw-r--r--lib/libpcap/scanner.l2
2 files changed, 11 insertions, 4 deletions
diff --git a/lib/libpcap/Makefile b/lib/libpcap/Makefile
index 614119b36b1..68cc80a9d4c 100644
--- a/lib/libpcap/Makefile
+++ b/lib/libpcap/Makefile
@@ -1,10 +1,10 @@
-# $OpenBSD: Makefile,v 1.4 1996/06/10 07:23:24 deraadt Exp $
+# $OpenBSD: Makefile,v 1.5 1996/06/18 16:26:20 deraadt Exp $
# $NetBSD: Makefile,v 1.3 1996/05/10 21:54:24 cgd Exp $
LIB= pcap
MAN= pcap.3
-CFLAGS+=-I. -I${.CURDIR}
+CFLAGS+=-I. -I${.CURDIR} -Dyylval=pcap_yylval
HDRS= pcap.h pcap-namedb.h
SRCS= pcap.c inet.c gencode.c optimize.c nametoaddr.c etherent.c \
@@ -12,7 +12,14 @@ SRCS= pcap.c inet.c gencode.c optimize.c nametoaddr.c etherent.c \
pcap-bpf.c
.PATH: ${.CURDIR}/../../sys/net
-CLEANFILES+= grammar.c scanner.c y.tab.h
+CLEANFILES+= grammar.c scanner.c grammar.tab.h
+
+grammar.c: grammar.y
+ ${YACC.y} -ppcap_yy -b ${.TARGET:R} ${.IMPSRC}
+ mv ${.TARGET:R}.tab.c ${.TARGET}
+
+scanner.c: scanner.l grammar.c
+ ${LEX.l} -Ppcap_yy -o${.TARGET} ${.IMPSRC}
includes:
@cd ${.CURDIR}; for i in $(HDRS); do \
diff --git a/lib/libpcap/scanner.l b/lib/libpcap/scanner.l
index fb627872ca5..89c0b8c59e9 100644
--- a/lib/libpcap/scanner.l
+++ b/lib/libpcap/scanner.l
@@ -36,7 +36,7 @@ static char rcsid[] =
#include <pcap-namedb.h>
#include "gencode.h"
-#include "y.tab.h"
+#include "grammar.tab.h"
#ifndef __GNUC__
#define inline