From owner-freebsd-current@FreeBSD.ORG Fri Nov 29 12:04:17 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB95B2A0; Fri, 29 Nov 2013 12:04:17 +0000 (UTC) Received: from mail-pb0-x235.google.com (mail-pb0-x235.google.com [IPv6:2607:f8b0:400e:c01::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9E20A11E8; Fri, 29 Nov 2013 12:04:17 +0000 (UTC) Received: by mail-pb0-f53.google.com with SMTP id ma3so14259713pbc.26 for ; Fri, 29 Nov 2013 04:04:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=CPiWwDJfXaT9X6k4gc9+XeP9XZ7FCUEwK9RI9ulEeHo=; b=f+i94GeALnOCU/24hHWiuYggijU6nnh0+rpYqWzykfeCqmYpS1sIhFko/48vlznuuh 8joAmvFqn9jRKg3vFnFI49JETnwEEl4mwguHJ/f6jiAMo2Vh2JeCcEw0EhM9AFponIKy SxcGGg12+tjpz1qu+oLgjk+HptPeCNq+Z+hQO0HvAhfO4dJGUMgBi5HZWl56m9dm8d8+ A8izEiFIOTi06/xeD0MaPx9l6mb29S9tJ35qunskP+msBPVzKj2NL/uBFOYgilJWfVII uJFEjLefMMg2+aOOuCRBGuCbxdUsS1FpWPOcTizAD5BfU1Sqi27cRgKwBLo2VrXdZjLx /DNg== MIME-Version: 1.0 X-Received: by 10.66.235.106 with SMTP id ul10mr51271947pac.19.1385726648578; Fri, 29 Nov 2013 04:04:08 -0800 (PST) Sender: ermal.luci@gmail.com Received: by 10.70.4.163 with HTTP; Fri, 29 Nov 2013 04:04:08 -0800 (PST) Date: Fri, 29 Nov 2013 13:04:08 +0100 X-Google-Sender-Auth: G_-4mzBOTmt4WcmGtCWd4q2Li_I Message-ID: Subject: [PATCH] SO_REUSEADDR and SO_REUSEPORT behaviour From: =?ISO-8859-1?Q?Ermal_Lu=E7i?= To: freebsd-net , "freebsd-current@freebsd.org" Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.16 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:04:17 -0000 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 bind 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 data 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