From owner-freebsd-bugs Sun Sep 10 16:10: 5 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 5E08937B423 for ; Sun, 10 Sep 2000 16:10:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id QAA73905; Sun, 10 Sep 2000 16:10:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from fun.ee.lbl.gov (fun.ee.lbl.gov [131.243.1.81]) by hub.freebsd.org (Postfix) with ESMTP id 04A1237B424 for ; Sun, 10 Sep 2000 16:02:10 -0700 (PDT) Received: (from leres@localhost) by fun.ee.lbl.gov (8.11.0/8.11.0) id e8AN29271497; Sun, 10 Sep 2000 16:02:09 -0700 (PDT) Message-Id: <200009102302.e8AN29271497@fun.ee.lbl.gov> Date: Sun, 10 Sep 2000 16:02:08 -0700 From: Craig Leres To: FreeBSD-gnats-submit@freebsd.org Cc: leres@ee.lbl.gov (Craig Leres) X-Send-Pr-Version: 3.2 Subject: bin/21177: [PATCH] ifinfo dumps core (plus other fixes) Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 21177 >Category: bin >Synopsis: [PATCH] ifinfo dumps core (plus other fixes) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Sep 10 16:10:01 PDT 2000 >Closed-Date: >Last-Modified: >Originator: Craig Leres >Release: FreeBSD 4.1-RELEASE i386 >Organization: Lawrence Berkeley National Laboratory >Environment: >Description: Ifinfo fails to compile; if you ifdef out the obsolete if_data struct references and your kerenl has gif(4) interfaces, it dumps core. It's also missing a few interface descriptions. >How-To-Repeat: fun 1182 % ifinfo [...] Interface gif0: flags: ffff8010 promiscuous listeners: 0 send queue length: 0 send queue max length: 50 send queue drops: 0 Segmentation fault (core dumped) >Fix: Appended is a context diff to tools/tools/ifinfo/ifinfo.c =================================================================== RCS file: RCS/ifinfo.c,v retrieving revision 1.1 diff -c -r1.1 ifinfo.c *** ifinfo.c 2000/09/10 22:44:21 1.1 --- ifinfo.c 2000/09/10 22:51:52 *************** *** 160,168 **** --- 160,170 ---- printf("\tinput queue drops: %lu\n", ifmd->ifmd_data.ifi_iqdrops); printf("\tpackets for unknown protocol: %lu\n", ifmd->ifmd_data.ifi_noproto); + #ifdef notdef printf("\treceive timing: %lu usec\n", ifmd->ifmd_data.ifi_recvtiming); printf("\ttransmit timing: %lu usec\n", ifmd->ifmd_data.ifi_xmittiming); + #endif } static const char *const if_types[] = { *************** *** 220,226 **** "SONETVT", "SMDS InterCarrier Interface", "Proprietary virtual interface", ! "Proprietary multiplexing" }; #define NIFTYPES ((sizeof if_types)/(sizeof if_types[0])) --- 222,231 ---- "SONETVT", "SMDS InterCarrier Interface", "Proprietary virtual interface", ! "Proprietary multiplexing", ! "Generic tunnel interface", ! "IPv6-to-IPv4 TCP relay capturing interface", ! "6to4 tunnel interface" }; #define NIFTYPES ((sizeof if_types)/(sizeof if_types[0])) *************** *** 229,235 **** { static char buf[256]; ! if (type <= 0 || type > NIFTYPES) { sprintf(buf, "unknown type %d", type); return buf; } --- 234,240 ---- { static char buf[256]; ! if (type <= 0 || type >= NIFTYPES) { sprintf(buf, "unknown type %d", type); return buf; } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message