From owner-svn-src-all@freebsd.org Sat Aug 20 11:43:03 2016 Return-Path: Delivered-To: svn-src-all@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 21D6ABBAEFA; Sat, 20 Aug 2016 11:43:03 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D84C3186A; Sat, 20 Aug 2016 11:43:02 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id E348620283; Sat, 20 Aug 2016 07:33:14 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 07:33:14 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=/8q/Kh34eNzdb/7HFT1hBSvn3HM=; b=Yksf5P LoBLgZYqB30PPamLHbExsD0J+fXYs+Rj96q+/QZef0BtqmbN/LIn1s0H+iBXek+x WnaEcu9pGU5IGRtd/Oh9k73L4c6W+2KUDTIG2/2lxY2uc1JttMCZYbiH85o2txhW 8vWYkS3hKfyYF06AI9DTSDeyBMxBCW/spMQiI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=/8q/Kh34eNzdb/7 HFT1hBSvn3HM=; b=g2FA/CfQmtMrfZyfrVjbgsvOmC1NXqn2qcd1dB8Li3XlZLS gIykxsnc1QlvJwcMBqAHYdwgQZdKAF5D0QH0CNzWFKmpNeTdlE5Kvr5ihYXFYK52 6lgBtIobmpstnKqplEBpfnl+9rMfrCzhEq1CtGWKvU6P40JygbxuIuyp0i1Y= X-Sasl-enc: Q4DfqWyUouwhaEvr13jaBRIrmFYT3qPyzIsVuIW0p9Hd 1471692794 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 2F0D0CCE69; Sat, 20 Aug 2016 07:33:14 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Ryan Stone , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201608182259.u7IMx5oW002018@repo.freebsd.org> From: Bruce Simpson Message-ID: <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> Date: Sat, 20 Aug 2016 12:33:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <201608182259.u7IMx5oW002018@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Aug 2016 11:43:03 -0000 This potentially breaks reception of IPv4 broadcasts where FreeBSD is the endpoint at the end of a P2P interface, or other forms of links, where there is no guarantee that the link layer will set M_BCAST (or indeed M_MCAST). On 18/08/16 23:59, Ryan Stone wrote: > Author: rstone > Date: Thu Aug 18 22:59:05 2016 > New Revision: 304436 > URL: https://svnweb.freebsd.org/changeset/base/304436 > > Log: > Don't check for broadcast IPs on non-bcast pkts > > in_broadcast() can be quite expensive, so skip calling it if the > incoming mbuf wasn't sent to a broadcast L2 address in the first > place. > > Reviewed by: gnn > MFC after: 2 months > Sponsored by: EMC / Isilon Storage Division > Differential Revision: https://reviews.freebsd.org/D7309 > > Modified: > head/UPDATING > head/sys/netinet/udp_usrreq.c > > Modified: head/UPDATING > ============================================================================== > --- head/UPDATING Thu Aug 18 22:59:00 2016 (r304435) > +++ head/UPDATING Thu Aug 18 22:59:05 2016 (r304436) > @@ -32,6 +32,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 > "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > > 20160818: > + The UDP receive code has been updated to only treat incoming UDP > + packets that were addressed to an L2 broadcast address as L3 > + broadcast packets. It is not expected that this will affect any > + standards-conforming UDP application. The new behaviour can be > + disabled by setting the sysctl net.inet.udp.require_l2_bcast to > + 0. > + > +20160818: > Remove the openbsd_poll system call. > __FreeBSD_version has been bumped because of this. > > > Modified: head/sys/netinet/udp_usrreq.c > ============================================================================== > --- head/sys/netinet/udp_usrreq.c Thu Aug 18 22:59:00 2016 (r304435) > +++ head/sys/netinet/udp_usrreq.c Thu Aug 18 22:59:05 2016 (r304436) > @@ -126,6 +126,11 @@ SYSCTL_INT(_net_inet_udp, OID_AUTO, blac > &VNET_NAME(udp_blackhole), 0, > "Do not send port unreachables for refused connects"); > > +static VNET_DEFINE(int, udp_require_l2_bcast) = 1; > +SYSCTL_INT(_net_inet_udp, OID_AUTO, require_l2_bcast, CTLFLAG_VNET | CTLFLAG_RW, > + &VNET_NAME(udp_require_l2_bcast), 0, > + "Only treat packets sent to an L2 broadcast address as broadcast packets"); > + > u_long udp_sendspace = 9216; /* really max datagram size */ > SYSCTL_ULONG(_net_inet_udp, UDPCTL_MAXDGRAM, maxdgram, CTLFLAG_RW, > &udp_sendspace, 0, "Maximum outgoing UDP datagram size"); > @@ -523,7 +528,8 @@ udp_input(struct mbuf **mp, int *offp, i > > pcbinfo = udp_get_inpcbinfo(proto); > if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) || > - in_broadcast(ip->ip_dst, ifp)) { > + ((!VNET_NAME(udp_require_l2_bcast) || m->m_flags & M_BCAST) && > + in_broadcast(ip->ip_dst, ifp))) { > struct inpcb *last; > struct inpcbhead *pcblist; > struct ip_moptions *imo; >