From owner-freebsd-current@FreeBSD.ORG Thu Jun 16 09:51:39 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 54CC016A41C for ; Thu, 16 Jun 2005 09:51:39 +0000 (GMT) (envelope-from mjl@luckie.org.nz) Received: from grunt9.ihug.co.nz (grunt9.ihug.co.nz [203.109.254.51]) by mx1.FreeBSD.org (Postfix) with ESMTP id C474E43D48 for ; Thu, 16 Jun 2005 09:51:38 +0000 (GMT) (envelope-from mjl@luckie.org.nz) Received: from 203-173-150-184.bliink.ihug.co.nz (lycra.luckie.org.nz) [203.173.150.184] by grunt9.ihug.co.nz with esmtp (Exim 3.35 #1 (Debian)) id 1Dir27-0004e1-00; Thu, 16 Jun 2005 21:51:35 +1200 Received: from 203-173-146-91.bliink.ihug.co.nz ([203.173.146.91] helo=[192.168.1.8]) by lycra.luckie.org.nz with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.51 (FreeBSD)) id 1Dir26-000GbO-6y for freebsd-current@freebsd.org; Thu, 16 Jun 2005 21:51:34 +1200 Message-ID: <42B14BA3.5050700@luckie.org.nz> Date: Thu, 16 Jun 2005 21:51:31 +1200 From: Matthew Luckie User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.8) Gecko/20050530 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-current@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: BPF writes on DLT_NULL devices X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2005 09:51:39 -0000 Hi -current I'm writing to see if I can find someone to review and commit a patch I submitted to PR 82157 as suggested by re@ http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/82157 The patch attempts to tidy up the mess that is BPF write on DLT_NULL devices. Some of these devices are handy to write to, e.g. tun, gif, and gre. There are a number of limitations and flaws in the -current code; namely * not all DLT_NULL devices support bpf write, including gif and gre * write() will fail if trying to send a packet larger than the IP MTU less 4 bytes, due to bpf_movein not taking into account the psuedo header * if_loop.c checks for bpf write in if_simloop; however the only device passing a packet via BPF to that function is looutput, yet looutput will return EAFNOSUPPORT because AF_UNSPEC is not checked in that function. Full details, including test code and a patch is available in the PR Any takers? Matthew