From owner-freebsd-net Wed Feb 7 12:23: 5 2001 Delivered-To: freebsd-net@freebsd.org Received: from iguana.aciri.org (iguana.aciri.org [192.150.187.36]) by hub.freebsd.org (Postfix) with ESMTP id 24EB637B65D for ; Wed, 7 Feb 2001 12:22:45 -0800 (PST) Received: (from rizzo@localhost) by iguana.aciri.org (8.11.1/8.11.1) id f17KMdR84116; Wed, 7 Feb 2001 12:22:39 -0800 (PST) (envelope-from rizzo) From: Luigi Rizzo Message-Id: <200102072022.f17KMdR84116@iguana.aciri.org> Subject: Re: send problem on udp socket... In-Reply-To: <200102072009.PAA46020@khavrinen.lcs.mit.edu> from Garrett Wollman at "Feb 7, 2001 3: 9: 3 pm" To: wollman@khavrinen.lcs.mit.edu (Garrett Wollman) Date: Wed, 7 Feb 2001 12:22:39 -0800 (PST) Cc: rizzo@aciri.org, wollman@khavrinen.lcs.mit.edu, bright@wintelcom.net, net@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL43 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > I've thought about this problem before, in the context of a TCP > sender, where the best solution is both (a) hard and (b) significantly > different. I had not thought about it in the case of UDP, but yes, > that could be a significant issue, particularly since UDP packets on > the receive queue can never be coalesced (so there's DoS potential). > > I think adding a (sort of) tail pointer to the socket buffer might be > helpful. I think you want it to point to the mbuf before the last > *record* in the socket buffer, in order for sbcompress() to do its oh yes, this is what i am actually implementing now: struct sockbuf { ... struct mbuf *sb_mb_head; /* the old sb_mb */ struct mbuf *sb_mb_tail; /* last record in chain */ ... the renaming of sb_mb is just a temporary thing to easily locate where the field is used. sb_mb_tail is only significant if sb_mb_head!=NULL and it is such that sb_mb_tail->m_nextpkt is always NULL. The change seems not too invasive, the only place which is unclear to me is uipc_usrreq.c:unp_scan(). Does the above sounds right ? cheers luigi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message