From: fenner Date: Wed, 30 May 2001 01:27:21 +0000 (+0000) Subject: Allow "ip6 proto ___" constructs. X-Git-Tag: libpcap-0.7.1~76 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/c3d1fa6983540466443dd6757961f1829ce20cd2 Allow "ip6 proto ___" constructs. Don't parse "ip6" if not compiled with ip6 support. --- diff --git a/gencode.c b/gencode.c index e85f6cfd..69392a50 100644 --- a/gencode.c +++ b/gencode.c @@ -21,7 +21,7 @@ */ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.152 2001-05-10 14:48:01 fenner Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.153 2001-05-30 01:27:21 fenner Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -2365,6 +2365,7 @@ lookup_proto(name, proto) case Q_DEFAULT: case Q_IP: + case Q_IPV6: v = pcap_nametoproto(name); if (v == PROTO_UNDEF) bpf_error("unknown ip proto '%s'", name); diff --git a/scanner.l b/scanner.l index 03e3fe20..ff292f18 100644 --- a/scanner.l +++ b/scanner.l @@ -22,7 +22,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/libpcap/scanner.l,v 1.77 2001-05-10 14:48:03 fenner Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/libpcap/scanner.l,v 1.78 2001-05-30 01:27:22 fenner Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -179,8 +179,20 @@ igrp return IGRP; pim return PIM; vrrp return VRRP; -ip6 return IPV6; -icmp6 return ICMPV6; +ip6 { +#ifdef INET6 + return IPV6; +#else + bpf_error("%s not supported", yytext); +#endif + } +icmp6 { +#ifdef INET6 + return ICMPV6; +#else + bpf_error("%s not supported", yytext); +#endif + } ah return AH; esp return ESP;