From owner-freebsd-hackers@freebsd.org Thu Jun 16 17:50:13 2016 Return-Path: Delivered-To: freebsd-hackers@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 0C605A770BD for ; Thu, 16 Jun 2016 17:50:13 +0000 (UTC) (envelope-from jk@kornberger.name) Received: from digineo.de (mail.digineo.de [185.55.116.143]) (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 C8364127F; Thu, 16 Jun 2016 17:50:11 +0000 (UTC) (envelope-from jk@kornberger.name) Received: from [10.196.58.38] (unknown [46.165.246.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jk) by digineo.de (Postfix) with ESMTPSA id 4E04260264; Thu, 16 Jun 2016 19:50:02 +0200 (CEST) Subject: Re: Usage of sosend() and its context To: John Baldwin , freebsd-hackers@freebsd.org References: <575F20CF.1020103@kornberger.name> <2110371.3nz8SNp04Y@ralph.baldwin.cx> From: Julian Kornberger Message-ID: <5762E6C6.7030401@kornberger.name> Date: Thu, 16 Jun 2016 19:49:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <2110371.3nz8SNp04Y@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 17:50:13 -0000 On 16.06.2016 18:40, John Baldwin wrote: > It's possible to ask sosend() to not block and fail with EWOULDBLOCK > instead by passing MSG_NOWAIT in flags. However, you might still block > on sblock(), so you may need to defer your work to a sleepable context > using something like a taskqueue. In this case I better build the IP packet manually and deliver it via ip_output/ip6_output. Do you know where I can find a code snipped that returns the recipient IP address and recipient UDP port of a IP4/IPv6 packet stored in a mbuf? -- Julian