From owner-freebsd-hackers Wed Jun 21 18:41:10 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id SAA16740 for hackers-outgoing; Wed, 21 Jun 1995 18:41:10 -0700 Received: from deep-thought.demos.su (root@deep-thought.demos.su [192.91.186.133]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id SAA16717 ; Wed, 21 Jun 1995 18:40:57 -0700 Received: by deep-thought.demos.su id FAA02630; (8.6.11/D) Thu, 22 Jun 1995 05:40:31 +0400 To: hackers@freebsd.org Cc: David Greenman , "Garrett A. Wollman" Message-ID: Organization: DEMOS Date: Thu, 22 Jun 1995 05:40:30 +0400 (MSD) X-Mailer: Mail/@ [v2.38 FreeBSD] From: =?KOI8-R?Q?=E1=CE=C4=D2=C5=CA_=FE=C5=D2=CE=CF=D7?= aka "Andrey A. Chernov, Black Mage" X-Class: Fast Subject: Fix NULL-encapsulated interfaces (lo & tun) handling (DLT_NULL) Lines: 47 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Length: 1119 Sender: hackers-owner@freebsd.org Precedence: bulk Any comments? I plan to commit... *** gencode.c.bak Tue Jun 13 02:01:05 1995 --- gencode.c Thu Jun 22 05:31:16 1995 *************** *** 471,478 **** return; case DLT_NULL: ! off_linktype = -1; ! off_nl = 0; return; case DLT_PPP: --- 471,478 ---- return; case DLT_NULL: ! off_linktype = 0; ! off_nl = 4; return; case DLT_PPP: *************** *** 543,548 **** --- 543,557 ---- if (proto == ETHERTYPE_IP) proto = 0x0021; /* XXX - need ppp.h defs */ break; + + case DLT_NULL: + if (proto == ETHERTYPE_IP) { + proto = htonl(AF_INET); /* loopback & tun put */ + /* sa_family into */ + /* prepended word */ + return gen_cmp(off_linktype, BPF_W, (long)proto); + } + break; } return gen_cmp(off_linktype, BPF_H, (long)proto); } -- Andrey A. Chernov : And I rest so composedly, /Now, in my bed, ache@astral.msk.su : That any beholder /Might fancy me dead - FidoNet: 2:5020/230.3 : Might start at beholding me, /Thinking me dead. RELCOM Team,FreeBSD Team : E.A.Poe From "For Annie" 1849