From owner-freebsd-amd64@FreeBSD.ORG Mon Oct 17 20:02:52 2011 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB87C1065676 for ; Mon, 17 Oct 2011 20:02:52 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 7E86C8FC16 for ; Mon, 17 Oct 2011 20:02:52 +0000 (UTC) Received: by vcbfo13 with SMTP id fo13so3922438vcb.13 for ; Mon, 17 Oct 2011 13:02:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=Y/XFAPOU0kYHU8hQkaQ/XzTbg36hzS1bKSJi+Vw8rDY=; b=D5krHRfrymDIOVs34WixCde/2yFSsJTxXtAmT4p6+pSMU3YydUnUxeJBIRLmq6HDDB 8SatOVDhUoN2CGv5L5yF/c7WnmeBj95RssbhZqYlW+Mi3IuVaDmUUEtwkU+GyacCHRJS 0ZtjXluymyJdgl8fUk+pzP60/KzQEnqREoYC4= MIME-Version: 1.0 Received: by 10.182.115.66 with SMTP id jm2mr12176455obb.38.1318881771569; Mon, 17 Oct 2011 13:02:51 -0700 (PDT) Received: by 10.182.216.38 with HTTP; Mon, 17 Oct 2011 13:02:51 -0700 (PDT) In-Reply-To: <102d01cc8d06$0fd26a70$2f773f50$@fisglobal.com> References: <714EF3C9-33B0-4EF5-B52C-1E95F7F432F9@fisglobal.com> <102d01cc8d06$0fd26a70$2f773f50$@fisglobal.com> Date: Tue, 18 Oct 2011 00:02:51 +0400 Message-ID: From: Sergey Kandaurov To: Devin Teske Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Dave Robison , FreeBSD amd64 Subject: Re: 32-bit route(8) on amd64 host and jails X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2011 20:02:52 -0000 On 17 October 2011 23:50, Devin Teske wrote: >> -----Original Message----- >> From: Sergey Kandaurov [mailto:pluknet@gmail.com] >> Sent: Friday, October 14, 2011 2:40 PM >> To: Devin Teske >> Cc: FreeBSD amd64; Dave Robison >> Subject: Re: 32-bit route(8) on amd64 host and jails >> >> On 21 September 2011 16:47, Sergey Kandaurov wrote: >> > On 21 September 2011 06:40, Devin Teske wr= ote: >> >> I'm noticing that a 32-bit route(8) shows strange behaviour while run= ning >> under an amd64 kernel (regardless of whether in the base-host -- utilizi= ng >> /usr/lib32/libc.so.7 -- or in a jail and/or vimage -- 32-bit in nature; > results are >> same). >> >> >> >> Executable runs fine, but you can't (a) set the default route or (b) = view > the >> default route (after successfully setting it with the amd64 build, of co= urse). >> >> >> >> ASIDE: This is under 8.1-RELEASE. >> >> >> >> When attempting to set the default route, you get the following... >> >> >> >> root@kps0a / # route add -net default 10.10.125.99 >> >> route: writing to routing socket: Invalid argument add net default: >> >> gateway 10.10.125.99: Invalid argument >> >> >> >> Meanwhile, using the amd64 version, no issues. >> >> >> >> When attempting to view the default route, you get the following... >> >> >> >> root@kps0a / # route -n get default >> >> =A0 route to: default >> >> destination: default >> >> =A0 =A0 =A0 mask: default >> >> =A0 =A0gateway: default >> >> =A0 =A0 =A0flags: >> >> =A0recvpipe =A0sendpipe =A0ssthresh =A0rtt,msec =A0 =A0mtu =A0 =A0 = =A0 =A0weight >> >> expire >> >> =A0 =A0 =A0 0 =A0 =A0 =A0 =A0 0 =A0 =A0 =A0 =A0 0 =A0 =A0 =A0 =A0 0 = =A0 =A0 =A0 =A0 0 =A0 =A0 =A0 =A0 0 >> >> -1316570637 >> >> >> >> It's the "gateway: default" that's out of place. >> >> >> > >> > Currently, FreeBSD has a poor shape of rtsocket freebsd32 >> > compatibility, AFAIK only sysctl layer (sysctl_rtsock) is aware of it. >> > That means when a 32bit app writes some data to a routing socket, >> > kernel expects to receive it in the native ABI, and it doesn't work. >> >> Can you please try this preliminary patch and report back? >> You only need to rebuild kernel and reboot with the attached patch to en= able > use >> of e.g. 32-bit route(8) command on amd64 kernel. >> No any userland utility needs to rebuild to enable the compatibility. >> Tested on 8.2 amd64 only with route get default and route delete/add. >> > > First-off, let me say thank you. The patch works as-expected (for amd64). Great, thanks! I will continue to clean up it to a committable state. > > ASIDE: attached is a patch that applies cleanly to RELENG_8_1 -- in case = anyone > is interested. > > However -- as you probably already know -- the patch should not be applie= d to > i386, else the following compiler error arises: > > #################### BEGIN COMPILER OUTPUT #################### > cc -c -O -pipe =A0-std=3Dc99 -g -Wall -Wredundant-decls -Wnested-externs > -Wstrict-prototypes =A0-Wmissing-prototypes -Wpointer-arith -Winline -Wca= st-qual > -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc =A0-I. -I../../.. > -I../../../contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include > opt_global.h -fno-common -finline-limit=3D8000 --param inline-unit-growth= =3D100 > --param large-function-growth=3D1000 =A0-mno-align-long-strings > -mpreferred-stack-boundary=3D2 =A0-mno-mmx -mno-3dnow -mno-sse -mno-sse2 = -mno-sse3 > -ffreestanding -fstack-protector -Werror =A0../../../net/rtsock.c > ../../../net/rtsock.c: In function 'route_output': > ../../../net/rtsock.c:1136: error: 'rp' undeclared (first use in this fun= ction) > ../../../net/rtsock.c:1136: error: (Each undeclared identifier is reporte= d only > once > ../../../net/rtsock.c:1136: error: for each function it appears in.) > ../../../net/rtsock.c: At top level: > ../../../net/rtsock.c:1156: error: expected identifier or '(' before 'ret= urn' > ../../../net/rtsock.c:1158: error: expected identifier or '(' before '}' = token > *** Error code 1 > #################### END COMPILER OUTPUT #################### > > Again, thank you for the patch! > -- > Devin > > P.S. +1 vote to get this cleaned-up and committed HEAD and then MFC'd to > RELENG_8 I hope to do that in some not so far future. > > P.P.S. Any chance there's a patch in the works to allow 32-bit "netstat -= nr" > under adm64 kernel? Currently comes back with "no name list". Yeah, this is a known issue to my regret. That will be a different one good project to make this work. > > ______________________________________________________________________ > The information contained in this message is proprietary and/or confident= ial. If you are not the intended recipient, please: (i) delete the message = and all copies; (ii) do not disclose, distribute or use the message in any = manner; and (iii) notify the sender immediately. In addition, please be awa= re that any message addressed to our domain is subject to archiving and rev= iew by persons other than the intended recipient. Thank you. > --=20 wbr, pluknet