Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libpcap more fallback #define. more friendly message on...



details:   https://anonhg.NetBSD.org/src/rev/b11c50be2bfc
branches:  trunk
changeset: 484903:b11c50be2bfc
user:      itojun <itojun%NetBSD.org@localhost>
date:      Fri Apr 14 14:26:35 2000 +0000

description:
more fallback #define.  more friendly message on "ip host ip6only-host"
or "ip6 host ip4only-host". (sync with tcpdump.org)

diffstat:

 lib/libpcap/ethertype.h |   5 ++++-
 lib/libpcap/gencode.c   |  23 +++++++++++++++++------
 2 files changed, 21 insertions(+), 7 deletions(-)

diffs (80 lines):

diff -r c907745ad2c2 -r b11c50be2bfc lib/libpcap/ethertype.h
--- a/lib/libpcap/ethertype.h   Fri Apr 14 14:25:40 2000 +0000
+++ b/lib/libpcap/ethertype.h   Fri Apr 14 14:26:35 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ethertype.h,v 1.4 1997/10/03 15:53:04 christos Exp $   */
+/*     $NetBSD: ethertype.h,v 1.5 2000/04/14 14:26:35 itojun Exp $     */
 
 /*
  * Copyright (c) 1993, 1994, 1996
@@ -73,6 +73,9 @@
 #ifndef ETHERTYPE_AARP
 #define ETHERTYPE_AARP         0x80f3
 #endif
+#ifndef ETHERTYPE_IPV6
+#define ETHERTYPE_IPV6         0x80f3
+#endif
 #ifndef        ETHERTYPE_LOOPBACK
 #define        ETHERTYPE_LOOPBACK      0x9000
 #endif
diff -r c907745ad2c2 -r b11c50be2bfc lib/libpcap/gencode.c
--- a/lib/libpcap/gencode.c     Fri Apr 14 14:25:40 2000 +0000
+++ b/lib/libpcap/gencode.c     Fri Apr 14 14:26:35 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gencode.c,v 1.22 2000/03/01 03:47:48 itojun Exp $      */
+/*     $NetBSD: gencode.c,v 1.23 2000/04/14 14:26:35 itojun Exp $      */
 
 /*
  * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -26,7 +26,7 @@
 static const char rcsid[] =
     "@(#) Header: gencode.c,v 1.93 97/06/12 14:22:47 leres Exp  (LBL)";
 #else
-__RCSID("$NetBSD: gencode.c,v 1.22 2000/03/01 03:47:48 itojun Exp $");
+__RCSID("$NetBSD: gencode.c,v 1.23 2000/04/14 14:26:35 itojun Exp $");
 #endif
 #endif
 
@@ -1223,8 +1223,12 @@
                b1 = gen_proto(IPPROTO_ICMP, Q_IP, Q_DEFAULT);
                break;
 
+#ifndef        IPPROTO_IGMP
+#define        IPPROTO_IGMP    2
+#endif
+
        case Q_IGMP:
-               b1 = gen_proto(2, Q_IP, Q_DEFAULT);
+               b1 = gen_proto(IPPROTO_IGMP, Q_IP, Q_DEFAULT);
                break;
 
 #ifndef        IPPROTO_IGRP
@@ -1232,9 +1236,12 @@
 #endif
        case Q_IGRP:
                b1 = gen_proto(IPPROTO_IGRP, Q_IP, Q_DEFAULT);
-               gen_and(b0, b1);
                break;
 
+#ifndef IPPROTO_PIM
+#define IPPROTO_PIM    103
+#endif
+
        case Q_PIM:
                b1 = gen_proto(IPPROTO_PIM, Q_IP, Q_DEFAULT);
 #ifdef INET6
@@ -2073,8 +2080,12 @@
                                b = tmp;
                        }
                        freeaddrinfo(res0);
-                       if (b == NULL)
-                               bpf_error("unknown host '%s'", name);
+                       if (b == NULL) {
+                               bpf_error("unknown host '%s'%s", name,
+                                   (proto == Q_DEFAULT)
+                                       ? ""
+                                       : " for specified address family");
+                       }
                        return b;
 #endif /*INET6*/
                }



Home | Main Index | Thread Index | Old Index