From owner-freebsd-hackers@freebsd.org Thu Jun 16 19:24:59 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 73F02A7780B for ; Thu, 16 Jun 2016 19:24:59 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55AD22AEC for ; Thu, 16 Jun 2016 19:24:59 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 1FC0DB96C; Thu, 16 Jun 2016 15:24:58 -0400 (EDT) From: John Baldwin To: Julian Kornberger Cc: freebsd-hackers@freebsd.org Subject: Re: Usage of sosend() and its context Date: Thu, 16 Jun 2016 11:30:39 -0700 Message-ID: <1489325.Tvgaf1skzf@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <5762E6C6.7030401@kornberger.name> References: <575F20CF.1020103@kornberger.name> <2110371.3nz8SNp04Y@ralph.baldwin.cx> <5762E6C6.7030401@kornberger.name> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 16 Jun 2016 15:24:58 -0400 (EDT) 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 19:24:59 -0000 On Thursday, June 16, 2016 07:49:58 PM Julian Kornberger wrote: > 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? udp_input/ip_input have to extract it. -- John Baldwin