From nobody Fri Nov 26 21:51:52 2021 X-Original-To: bugs@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 480C018C1B10 for ; Fri, 26 Nov 2021 21:51:53 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J17kJ3lmmz4dv2 for ; Fri, 26 Nov 2021 21:51:52 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6140F107E5 for ; Fri, 26 Nov 2021 21:51:52 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 1AQLpqoq027135 for ; Fri, 26 Nov 2021 21:51:52 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 1AQLpqcY027134 for bugs@FreeBSD.org; Fri, 26 Nov 2021 21:51:52 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 260055] recvmsg / IP_RECVDSTADDR issue Date: Fri, 26 Nov 2021 21:51:52 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 12.2-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: kib@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637963512; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=z8QBcpLTsAvi9XNRu7vpMNRD1zizqRDHcrZjd0wKphk=; b=okW95dJtunqKIcSGUGk/uV20qsIAOPi+0NW4oBX+HAVFeOS+x0DqShAWryErJM6ZiI7FoA DBeIGC9DHzVmm9WXIGHvpK5NcGI4cK7OZIC2AODZmXqCNAoK0TTDoCKd93wMzvzmrf15hf 2Sy5ZdXDQ136PNROKHZ6Lfi9wXeQrPLGuqNyrIo4SApCsQ9R2oys0anN1f1nj6OmmA0EBw XCntKdtIbWXTPFssRa7z8ibEv2X/epvZTfMFygjLyAKJm8hLlAyanyV5k/WH4FiL/Q5LR1 QUz3sbhxieW334wB2sh3InmmHnMTeoKkxmes24M+4pVyc3aDGVVnvKAFO65IiA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637963512; a=rsa-sha256; cv=none; b=ABZtj/VqLVcHmfTe2Dx+5cZMfWxBMfG7JOy7CTYKWdZCOPUmg2dTHfuCL3uE6+mjs2k7ez 9X+FtOSmuIK26bao8w8SP6VPopM3blyjarHrv6Dp4H40bObDc2GrWmTxBYwL1ZU8Rp3kEU R5hCykMv7uIaSsDzMlhPzO0rR8s7FlkboI9iJfe4THinEP2eloxAYLLKpge4CAEvYYY+DV GXXnYSjKg50XB7sQ1snrdf9pKSSdVEt9GeiLlBegsP/HErl95iQlv2b97HYJETQLyynqeN yKMx+WTEO8GnrBEy6L1F3sFiTtFFt17N1zP1sKhSMMEO4eCfwqY7RTUL0oxGjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D260055 --- Comment #3 from Konstantin Belousov --- > Maybe there is some application logic error if some payload data is disca= rded, > but recvmsg() still has control message to return because of IP_RECVDSTAD= DR > socket option, hasn't it? So it should not block just after first UDP dat= agramm > arrived, I believe. No, this is completely off how the control messages work. You do not have control message 'sit' in the socket buffer. CMSG is generated _on the pack= et insertion into the sockbuf queue_. On receive, associated cmsg is either externalized and copied out, if cmsg buffer is provided by userspace, or simply dropped. So the behavior you see is probably right (I cannot assert if fully because I do not know app logic and protocol): you have blocked socket, which somet= imes happens to have empty receive queue, and you call recvmsg(2) on it. Until something is received, the syscall is blocked. --=20 You are receiving this mail because: You are the assignee for the bug.=