Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 May 2009 09:20:45 +0200
From:      Thomas Mueller <tmueller@sysgo.com>
To:        Chagin Dmitry <dchagin@freebsd.org>
Cc:        freebsd-emulation@freebsd.org
Subject:   Re: kern/134276: [linux][patch] MSG_NOSIGNAL not translated for recv(), socket timeout incorrect for 64-bit hosts
Message-ID:  <20090511092045.4e18692c@tom.ulm.sysgo.com>
In-Reply-To: <20090509080609.GA4415@dchagin.static.corbina.ru>
References:  <200905090700.n49704gb019256@freefall.freebsd.org> <20090509080609.GA4415@dchagin.static.corbina.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 9 May 2009 12:06:09 +0400, Chagin Dmitry wrote:
> On Sat, May 09, 2009 at 07:00:04AM +0000, Thomas Mueller wrote:
> > The following reply was made to PR kern/134276; it has been noted by GNATS.
> > 
> > From: Thomas Mueller <tmueller@sysgo.com>
> > To: Chagin Dmitry <dchagin@freebsd.org>
> > Cc: freebsd-gnats-submit@freebsd.org
> > Subject: Re: kern/134276: [linux][patch] MSG_NOSIGNAL not translated for
> >  recv(), socket timeout incorrect for 64-bit hosts
> > Date: Sat, 9 May 2009 08:30:53 +0200
> > 
> >  > > I've encountered two socket related problems with the Linux emulation:
> >  > > 
> >  > > 1. A Linux application passing the MSG_NOSIGNAL flag in calls to 
> >  > >    recv() or recvfrom() will still receive a SIGPIPE if the condition
> >  > >    for sending the signal is met.
> >  > > 
> >  > > 2. An attempt to set socket timeouts with a call to setsocktopt() using the 
> >  > >    SO_RECVTIMEO or SO_SNDTIMEO option will fail with [EINVAL] on amd64.
> >  > > 
> >  > 
> >  > What the Linux application you have mentioned?
> >  > I should know it to test patches. Thank you.
> >  
> >  Sorry for not mentioning it in the PR. The applications are part of the
> >  LM-X License Manager package by X-Formation (http://www.x-formation.com/).
> >  It looks like they offer a trial download but require registration.
> >  
> >  When back in the office (next weeek), I could revert my local changes
> >  and provide you with an output of linux_kdump if that helps. I would
> >  also test patches.
> >  
> >  
> 
> Thank you,
> 
> Please, apply this two patches.
> 
> http://people.freebsd.org/~dchagin/patches/commit-4952ce8.patch

In linux_setsockopt() when calling kern_setsockopt() for
SO_RCVTIMEO/SO_SNDTIMEO you need to pass 'name' instead of
'bsd_args.name' since the latter is still undefined at that point:

--- commit-4952ce8.patch.orig   2009-05-11 09:07:56.000000000 +0200
+++ commit-4952ce8.patch        2009-05-11 09:08:09.000000000 +0200
@@ -39,7 +39,7 @@
 +                      tv.tv_sec = linux_tv.tv_sec;
 +                      tv.tv_usec = linux_tv.tv_usec;
 +                      return (kern_setsockopt(td, bsd_args.s, bsd_args.level,
-+                          bsd_args.name, &tv, UIO_SYSSPACE, sizeof(tv)));
++                          name, &tv, UIO_SYSSPACE, sizeof(tv)));
 +                      break;
 +              default:
 +                      break;

> http://people.freebsd.org/~dchagin/patches/commit-6355ebf.patch


-- 
Thomas Mueller  



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090511092045.4e18692c>