From owner-freebsd-current Tue Feb 27 17:24:14 2001 Delivered-To: freebsd-current@freebsd.org Received: from mail.gmx.net (pop.gmx.net [194.221.183.20]) by hub.freebsd.org (Postfix) with SMTP id 5A24737B71B for ; Tue, 27 Feb 2001 17:24:11 -0800 (PST) (envelope-from tmoestl@gmx.net) Received: (qmail 17428 invoked by uid 0); 28 Feb 2001 01:24:09 -0000 Received: from p3e9e0415.dip.t-dialin.net (HELO forge.local) (62.158.4.21) by mail.gmx.net (mail02) with SMTP; 28 Feb 2001 01:24:09 -0000 Received: from tmm by forge.local with local (Exim 3.20 #1) id 14XvLg-0001s2-00 for ; Wed, 28 Feb 2001 02:24:12 +0100 Date: Wed, 28 Feb 2001 02:24:12 +0100 From: Thomas Moestl To: current@FreeBSD.ORG Subject: Re: [PATCH] for linux_connect (ugly) Message-ID: <20010228022412.A7084@crow.dom2ip.de> Mail-Followup-To: Thomas Moestl , current@FreeBSD.ORG References: <3A6C7C25.A6101656@cup.hp.com> <20010228015515.A6763@crow.dom2ip.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010228015515.A6763@crow.dom2ip.de>; from tmoestl@gmx.net on Wed, Feb 28, 2001 at 01:55:15AM +0100 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, Feb 28, 2001 at 01:55:15AM +0100, Thomas Moestl wrote: > On Wed, Feb 28, 2001 at 01:17:12AM +0100, Martin Blapp wrote: > > Thomas Moestl and I tried to fix linux_connect. Most of this patch > > is from Thomas Moestl. I did only a little part of it and testing. > > > > Staroffice5.2 has been broken about one year now, and it needs > > a fix with the same behaviour to work correctly with FreeBSD. > > > > This patch should be rewritten so it can be comitted to CURRENT > > and (IMPORTANT) to STABLE before 4.3 is out. > > > > + /* > > + * Ugly kluge: some applications depend on 0 being > > + * returned only the first time. Therefore, we set > > + * the (otherwise invisible) SO_KNBCONN flag. > > + * If it is set, return EISCONN. > > + */ > > + error = holdsock(p->p_fd, linux_args.s, &fp); > > + if (error) > > + return (error); > > + iconn = ((struct socket *)fp->f_data)->so_options & > > + SO_KNBCONN; > > + ((struct socket *)fp->f_data)->so_options |= SO_KNBCONN; > > + fdrop(fp, p); > > + > > + if (iconn) > > + return (EISCONN); I have forgotten to add that if we fiddle with the socket's internals anyway, this should probably be put into the socket state. This really is a quick hack, but maybe it can be sanitized to be useful. - thomas To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message