From owner-freebsd-transport@freebsd.org Mon Jul 25 18:09:54 2016 Return-Path: Delivered-To: freebsd-transport@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD7C8B9C775 for ; Mon, 25 Jul 2016 18:09:54 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-it0-x230.google.com (mail-it0-x230.google.com [IPv6:2607:f8b0:4001:c0b::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 725BF1469 for ; Mon, 25 Jul 2016 18:09:54 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-it0-x230.google.com with SMTP id u186so91200533ita.0 for ; Mon, 25 Jul 2016 11:09:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Z90URC3ZkcYakzOHpVpwnG1iWuPc+Wobjdoq48b1qZ8=; b=ZBDtBs7OXboV/+8uljbwfIs+OM8A9+Z3aTVfc2an+ZmoilXL1kd8RhCd5eW2bSZrM1 NSlbvMgSJ/tZh6VtAkvJGsqfHqAjyof9P3riR6zZcs0LyNi47w93wya1o+Lk1uj5N9vt gFNL5D535qLZZpsQJWSuFc5grTiqXnBHWU7CEx3C4fP3G+I6aBgzEH7Guz6P7TvO0KIk HLP/e7rlAOSLGI556WfdaB8Z8+C1KDIBWDIF9SJyBN8eR3IftoMGBBguWtFWHiNbDNnF ByJzj+3Zb/mA27iutMeLSsvDifuJ5Trh5mEzcd+spQtQLRmw6FlqOSnxHZM16lcBemp/ 8tBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Z90URC3ZkcYakzOHpVpwnG1iWuPc+Wobjdoq48b1qZ8=; b=L9wXToc9JVXymAoqIz7ZOGllctFRJJnPhkJnHLw3D9Uek4T8ttz5V+IXz6t+e5CwrP Rqg8d9f5ipy1Tf7Zu9nXjxjRIfxi/twoMlEsGFZ3bbdy6S+RlmQX1BC+NE7uLaCtQICD mev0/8OnBAO1fz1EnpUPEu6RadwbX0hiQCtaEhd+JlfqdgfwCwHmB7TpOO+YcyxIBNUt Cv1EW1QWfHI2hyH2uaZkc7hvhfOJOMf5iXywEOEvUVRuL0OtQuz5Fpjx7cToMcwo4I6Y kk8zwB4OTEkHJiBop9lyeSpQzKU1A7DuIHxFDOOPH98pPhwi/zGwdGUfquWJdJUDDc1p khzQ== X-Gm-Message-State: AEkoouuWbxmD0opzkWlbTz6p5HmaEuE0CvwyqVfOXj+iSQ0S4fvwj2zE9JJF+JwMLh7ejactAKlkvYeIAa2dlw== X-Received: by 10.36.21.65 with SMTP id 62mr22505850itq.20.1469470193988; Mon, 25 Jul 2016 11:09:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.200.71 with HTTP; Mon, 25 Jul 2016 11:09:53 -0700 (PDT) In-Reply-To: References: <559f1d0e-9d35-f458-bff5-b69a03297cf0@netflix.com> From: Ryan Stone Date: Mon, 25 Jul 2016 14:09:53 -0400 Message-ID: Subject: Re: in_broadcast() called for almost every packet in ip_output() To: Adrian Chadd Cc: Andrew Gallatin , "" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: freebsd-transport@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Discussions of transport level network protocols in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 18:09:54 -0000 On Wed, Jul 20, 2016 at 7:57 PM, Ryan Stone wrote: > Would it be correct to check for M_BCAST on the packet before checking for > for a broadcast IP address? I don't believe that there would be any > security concerns with that approach. If somebody injected a UDP packet > with a broadcast IP address but a unicast MAC address, we would try to look > up a pcb that matched, fail to find anything, and then drop the packet. > Ok, I've put this up for review, along with a fix for the 802.11 stack to have it set M_BCAST properly: https://reviews.freebsd.org/D7309 Are there any other L2 protocols that we support other than Ethernet and 802.11 that I should audit to ensure it sets M_BCAST properly.