From nobody Tue Oct 04 11:37:56 2022 X-Original-To: net@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MhbL56MfXz4dfRK for ; Tue, 4 Oct 2022 11:38:05 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4MhbL42HvLz3S5D; Tue, 4 Oct 2022 11:38:04 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from [192.168.1.100] (unknown [98.60.75.233]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 3BE541AF400; Tue, 4 Oct 2022 11:37:57 +0000 (UTC) Message-ID: <896ee089-27ad-c98f-6bf9-4b05caf778fd@freebsd.org> Date: Tue, 4 Oct 2022 05:37:56 -0600 List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Subject: Re: in_pcbbind_setup: wrong condition regarding INP_REUSEPORT ? Content-Language: en-US To: Andriy Gapon , "net@FreeBSD.org" References: From: Sean Bruno In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4MhbL42HvLz3S5D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=softfail (mx1.freebsd.org: 199.102.79.106 is neither permitted nor denied by domain of sbruno@freebsd.org) smtp.mailfrom=sbruno@freebsd.org X-Spamd-Result: default: False [-2.07 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-0.97)[-0.971]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_TWO(0.00)[2]; MLMMJ_DEST(0.00)[net@FreeBSD.org]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:36236, ipnet:199.102.76.0/22, country:US]; RCVD_TLS_ALL(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; FREEFALL_USER(0.00)[sbruno]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; TO_DN_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N On 10/3/22 04:14, Andriy Gapon wrote: > > I must admit that the condition in question is fairly long and > non-trivial and I cannot decipher it, but these two lines look wrong to me: > >                                      (t->inp_flags2 & INP_REUSEPORT) || >                                      (t->inp_flags2 & INP_REUSEPORT_LB) > == 0) && > > I'd expect that the check would be symmetric with respect to > INP_REUSEPORT and INP_REUSEPORT_LB. > The problem seems to come from 1a43cff92a20d / r334719 / D11003. > I think you are pointing at this absurd conditional? https://cgit.freebsd.org/src/tree/sys/netinet/in_pcb.c#n1049 Besides the twisted logic, what problem are you trying to solve? sean