From owner-freebsd-current@FreeBSD.ORG Fri Nov 29 12:19:50 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 94C4269E; Fri, 29 Nov 2013 12:19:50 +0000 (UTC) Received: from mail-la0-x233.google.com (mail-la0-x233.google.com [IPv6:2a00:1450:4010:c03::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AF41C12A9; Fri, 29 Nov 2013 12:19:49 +0000 (UTC) Received: by mail-la0-f51.google.com with SMTP id ec20so6846952lab.10 for ; Fri, 29 Nov 2013 04:19:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=77XKm/7UVD72Kg0lAy4x0DO+xI0mfk3HqREjClEYdCY=; b=SCAeg4K92n6prQh4mlVZdUoGNPrYUC6mn33AfaG6YwiYLoaUKHUPm/uI3P7BDAsxS6 WkQxbo49Xfn02D94BdBsna39NNeDFcYb+SP2PkR9zVZ1XCu16pFj+/45ykE30C6Gqdjn WktD5SJ/VCnu/gt3nFPiAwdG8ZoygE5FTpk+zVobNu0XVi9EAI+tUXO2hZr/39YP7pM6 EmL5Wg5o4o0StNzGBtLmUjSll+iBBWe8ADSe+iDgKxPpS39O0A5UUazC2wNKe00ICCuA VO9bquHet+nqrLc9RkLYuUipG/ZSxSNqSU55itBEZqlMIhhTMexF571YS9anMar20Awk ZM6Q== MIME-Version: 1.0 X-Received: by 10.112.52.33 with SMTP id q1mr1463243lbo.30.1385727587656; Fri, 29 Nov 2013 04:19:47 -0800 (PST) Received: by 10.112.140.132 with HTTP; Fri, 29 Nov 2013 04:19:47 -0800 (PST) In-Reply-To: References: Date: Fri, 29 Nov 2013 13:19:47 +0100 Message-ID: Subject: Re: [PATCH] SO_REUSEADDR and SO_REUSEPORT behaviour From: Daniel Nebdal To: =?ISO-8859-1?Q?Ermal_Lu=E7i?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.16 Cc: freebsd-net , "freebsd-current@freebsd.org" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.16 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: Fri, 29 Nov 2013 12:19:50 -0000 On Fri, Nov 29, 2013 at 1:04 PM, Ermal Lu=E7i wrote: > Hello, > > since SO_REUSEADDR and SO_REUSEPORT are supposed to allow two daemons to > share the same port and possibly listening ip, you would expect if you bi= nd > two daemon with such options to same port to see the same traffic on both= ! > > This is not the case today. > Only multicast sockets seem to have the behaviour of broadcasting the dat= a > to all sockets sharing the same properties through these options! > > The patch at [1] implements/corrects the behaviour for UDP sockets. > Is there anything to be corrected in that patch? > Why it has not been provided there before? > Can it be committed to the tree? > Any extra security checks for jails needed there? > > > [1] > > https://github.com/pfsense/pfsense-tools/blob/master/patches/RELENG_10_0/= udp_SO_REUSEADDR%2BPORT.diff > > -- > Ermal I understood it as working sort of like for TCP, where packages from a given remote host+port all end up at exactly one of the local sockets? If the idea is to split the workload over multiple threads holding their own sockets listening to the same interface+port, wouldn't sending all packets to all sockets all the time be kind of counterproductive? Of course, I haven't actually used it much; I might be wrong. --=20 Daniel Nebdal