Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 May 2009 20:07:24 +0400
From:      Chagin Dmitry <dchagin@freebsd.org>
To:        Boris Samorodov <bsam@ipt.ru>
Cc:        Alexander Leidinger <Alexander@Leidinger.net>, freebsd-emulation@freebsd.org
Subject:   Re: [linux-f10] linux_socketcall... ERR#43 'Protocol not supported'
Message-ID:  <20090505160724.GB14703@dchagin.static.corbina.ru>
In-Reply-To: <67678219@bb.ipt.ru>
References:  <81924694@bb.ipt.ru> <20090505144955.16373k1b32dpaxo0@webmail.leidinger.net> <47993241@bb.ipt.ru> <20090505160827.1359651x47bqmxc8@webmail.leidinger.net> <67678219@bb.ipt.ru>

next in thread | previous in thread | raw e-mail | index | archive | help

--CUfgB8w4ZwR/yMy5
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, May 05, 2009 at 07:26:28PM +0400, Boris Samorodov wrote:
> On Tue, 05 May 2009 16:08:27 +0200 Alexander Leidinger wrote:
> > Quoting Boris Samorodov <bsam@ipt.ru> (from Tue, 05 May 2009 17:44:54 +=
0400):
> > > On Tue, 05 May 2009 14:49:55 +0200 Alexander Leidinger wrote:
> > >> Quoting Boris Samorodov <bsam@ipt.ru> (from Tue, 05 May 2009
> > >> 09:51:21 +0400):
> > >
> > >> > I'm working on Fedora 10 ports and almost all is fine (even
> > >> > google-earth seems to work)... But there is no resolving.
> > >> > I managed to find the culprit. Here it is:
> > >
> > >> > Ktrace/linux_kdump gives this:
> > >> > -----
> > >> >  48833 ping     CALL  linux_socketcall(0x1,0xbfbfd218)
> > >> >  48833 ping     RET   linux_socketcall -1 errno 93 Unknown error: =
93
> > >> >  48833 ping     CALL  gettimeofday(0xbfbfd2e0,0)
> > >> >  48833 ping     RET   gettimeofday 0
> > >> >  48833 ping     CALL  linux_socketcall(0x1,0xbfbfd218)
> > >> >  48833 ping     RET   linux_socketcall -1 errno 93 Unknown error: =
93
> > >> >  48833 ping     CALL  write(0x2,0xbfbfbf48,0x1a)
> > >> >  48833 ping     GIO   fd 2 wrote 26 bytes
> > >> >        "ping: unknown host www.ru
> > >> >        "
> > >> >  48833 ping     RET   write 26/0x1a
> > >> >  48833 ping     CALL  linux_exit_group(0x2)
> > >> > ----
> > >
> > >> There was a commit after April 30 about linux socket stuff. I don't
> > >> know if it is related or not. You can either update and test, or
> > >
> > > Thanks for the info, I'm updating now.
> > >
> > >> instrument the current code to print out the parameters to
> > >> linux_socketcall in a human readable way.
> > >
> > > Can you give a tiny example?
>=20
> [Skip examples, thanks]
>=20
> The diff is:
> -----
> --- linux_socket.c.orig	2009-05-05 18:35:31.000000000 +0400
> +++ linux_socket.c	2009-05-05 19:02:42.000000000 +0400
> @@ -595,9 +595,15 @@
>  	} */ bsd_args;
>  	int retval_socket;
> =20
> +	printf("bsam: linux_socket (LINUX): domain: %d, type: %d, protocol: %d\=
n",
> +		args->domain, args->type, args->protocol);
> +
>  	bsd_args.protocol =3D args->protocol;
>  	bsd_args.type =3D args->type;
>  	bsd_args.domain =3D linux_to_bsd_domain(args->domain);
> +
> +	printf("bsam: linux_socket (FreeBSD): domain: %d\n", bsd_args.domain);
> +
>  	if (bsd_args.domain =3D=3D -1)
>  		return (EINVAL);
> =20
> @@ -1365,10 +1371,14 @@
>  linux_socketcall(struct thread *td, struct linux_socketcall_args *args)
>  {
>  	void *arg =3D (void *)(intptr_t)args->args;
> +	int ret;
> =20
> +	printf("bsam: Entering linux_socketcall.\n");
>  	switch (args->what) {
>  	case LINUX_SOCKET:
> -		return (linux_socket(td, arg));
> +		ret =3D linux_socket(td, arg);
> +		printf("bsam: LINUX_SOCKET: %d\n", ret);
> +		return (ret);
>  	case LINUX_BIND:
>  		return (linux_bind(td, arg));
>  	case LINUX_CONNECT:
> -----
>=20
> Console diagnistic is:
> -----
> May  5 19:10:33 bb kernel: bsam: Entering linux_socketcall.
> May  5 19:10:33 bb kernel: bsam: linux_socket (LINUX): domain: 2, type: 3=
, protocol: 1
> May  5 19:10:33 bb kernel: bsam: linux_socket (FreeBSD): domain: 2
> May  5 19:10:33 bb kernel: bsam: LINUX_SOCKET: 1
> May  5 19:10:33 bb kernel: bsam: Entering linux_socketcall.
> May  5 19:10:33 bb kernel: bsam: linux_socket (LINUX): domain: 1, type: 5=
26337, protocol: 0
> May  5 19:10:33 bb kernel: bsam: linux_socket (FreeBSD): domain: 1
> May  5 19:10:33 bb kernel: bsam: LINUX_SOCKET: 43
> May  5 19:10:33 bb kernel: bsam: Entering linux_socketcall.
> May  5 19:10:33 bb kernel: bsam: linux_socket (LINUX): domain: 1, type: 5=
26337, protocol: 0
> May  5 19:10:33 bb kernel: bsam: linux_socket (FreeBSD): domain: 1
> May  5 19:10:33 bb kernel: bsam: LINUX_SOCKET: 43
> May  5 19:10:34 bb kernel: bsam: Entering linux_socketcall.
> May  5 19:10:34 bb kernel: bsam: linux_socket (LINUX): domain: 2, type: 2=
050, protocol: 0
> May  5 19:10:34 bb kernel: bsam: linux_socket (FreeBSD): domain: 2
> May  5 19:10:34 bb kernel: bsam: LINUX_SOCKET: 43
> May  5 19:10:34 bb kernel: bsam: Entering linux_socketcall.
> May  5 19:10:34 bb kernel: bsam: linux_socket (LINUX): domain: 2, type: 2=
050, protocol: 0
> May  5 19:10:34 bb kernel: bsam: linux_socket (FreeBSD): domain: 2
> May  5 19:10:34 bb kernel: bsam: LINUX_SOCKET: 43
> -----
>=20
> Corresponding text for linux_kdump and truss:
> ftp://ftp.ipt.ru/pub/linux/linux_kdump.ping.txt
> ftp://ftp.ipt.ru/pub/linux/truss.ping.txt
>=20

heh, it seems to me that SOCK_CLOEXEC, SOCK_NONBLOCK bits used.
should be fixed. socketpair() also uses it since 2.6.29

--=20
Have fun!
chd

--CUfgB8w4ZwR/yMy5
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (FreeBSD)

iEYEARECAAYFAkoAZDkACgkQ0t2Tb3OO/O1OfgCeOlFVdtcSvKeCE3mEDdoZ196a
Aj4AoMZ+Rx/AN6PYzXPtd4Ki9PeUOGEW
=3Zmx
-----END PGP SIGNATURE-----

--CUfgB8w4ZwR/yMy5--



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