From owner-freebsd-bugs@FreeBSD.ORG Mon Sep 7 22:40:02 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F206C1065679 for ; Mon, 7 Sep 2009 22:40:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id CF9B28FC17 for ; Mon, 7 Sep 2009 22:40:01 +0000 (UTC) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n87Me1Q1016789 for ; Mon, 7 Sep 2009 22:40:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n87Me1Au016788; Mon, 7 Sep 2009 22:40:01 GMT (envelope-from gnats) Resent-Date: Mon, 7 Sep 2009 22:40:01 GMT Resent-Message-Id: <200909072240.n87Me1Au016788@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Sten Spans Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD8951065679 for ; Mon, 7 Sep 2009 22:30:19 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id AD1978FC18 for ; Mon, 7 Sep 2009 22:30:19 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n87MUJwW075680 for ; Mon, 7 Sep 2009 22:30:19 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n87MUJEC075679; Mon, 7 Sep 2009 22:30:19 GMT (envelope-from nobody) Message-Id: <200909072230.n87MUJEC075679@www.freebsd.org> Date: Mon, 7 Sep 2009 22:30:19 GMT From: Sten Spans To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/138620: lagg port bpf-writes blocked X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2009 22:40:02 -0000 >Number: 138620 >Category: kern >Synopsis: lagg port bpf-writes blocked >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: Mon Sep 07 22:40:01 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Sten Spans >Release: 8.0-BETA4 >Organization: >Environment: FreeBSD towel.blinkenlights.nl 8.0-BETA4 FreeBSD 8.0-BETA4 #0: Sun Sep 6 04:44:31 UTC 2009 root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 >Description: I have an application which sends link-layer advertisements on physical interfaces. This daemon also informs switches about lacp settings via LLDP. Because this daemon sends link-layer advertisements it needs to transmit on physical interfaces. However the lagg driver blocks bpf-writes on member interfaces, which makes it impossible for my software to do what it needs to do. The load-balancing / failover algorithms implemented by lagg make it impossible to send on all physical interfaces via the parent lagg interface. Please note that the bridge driver on FreeBSD doesn't implement the same restrictions. Please consider allowing bpf-writes via lagg_port_output for the people who know what they're doing. In general allowing pseudo_AF_HDRCMPLT should be a reasonable compromise. >How-To-Repeat: ifconfig lagg0 create up ifconfig tap0 create up ifconfig lagg0 laggport tap0 ifconfig tap1 create up ifconfig lagg0 laggport tap1 child_send: starting loop with interface lagg0 child_send: fetching tap1 media details netif_media: media detection not supported on tap1 child_send: building LLDP packet for tap1 child_send: sending LLDP packet (225 bytes) on tap1 master_send: only -1 bytes written: Device busy child_send: fetching tap0 media details netif_media: media detection not supported on tap0 child_send: building LLDP packet for tap0 child_send: sending LLDP packet (225 bytes) on tap0 master_send: only -1 bytes written: Device busy >Fix: Patch attached with submission follows: --- if_lagg.c.orig 2009-09-08 00:17:17.000000000 +0200 +++ if_lagg.c 2009-09-08 00:18:22.000000000 +0200 @@ -702,6 +702,7 @@ switch (dst->sa_family) { case pseudo_AF_HDRCMPLT: + return ((*lp->lp_output)(ifp, m, dst, rt0)); case AF_UNSPEC: eh = (struct ether_header *)dst->sa_data; type = eh->ether_type; >Release-Note: >Audit-Trail: >Unformatted: