From owner-freebsd-jail@FreeBSD.ORG Sat Apr 18 21:28:50 2015 Return-Path: Delivered-To: freebsd-jail@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C4E476E for ; Sat, 18 Apr 2015 21:28:50 +0000 (UTC) Received: from elektropost.org (elektropost.org [217.115.13.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72761393 for ; Sat, 18 Apr 2015 21:28:48 +0000 (UTC) Received: (qmail 1416 invoked from network); 18 Apr 2015 21:23:34 -0000 Received: from elektropost.org (HELO elektropost.org) (erdgeist@erdgeist.org) by elektropost.org with ESMTPS (DHE-RSA-AES128-SHA encrypted); 18 Apr 2015 21:23:34 -0000 Message-ID: <5532CB4A.5030703@erdgeist.org> Date: Sat, 18 Apr 2015 23:23:22 +0200 From: Dirk Engling User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: freekai , freebsd-jail@freebsd.org Subject: Re: Create Jail fail by c language References: In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 21:28:50 -0000 On 18.04.15 17:34, freekai wrote: > 18 j.ip4s=inet_addr(cp); >From the man page: > The “ip4s” and “ip6s” give the numbers of IPv4 and IPv6 addresses > that will be passed via their respective pointers. so it should rather read: > 18 j.ip4s=1; > 19 j.ip6s=0; > 20 > 21 if(1!=inet_aton(cp,&ip4)) > 22 printf("the address is invalid\r\n"); > 23 > 24 j.ip4=&ip4; > The problem is it will print `einval`,it means `The version number of the argument is not correct.` > How to solve it? Also, the man pages states several other reasons for the EINVAL return code (scroll further down), one of them being [EINVAL] A supplied parameter is the wrong size. Regards erdgeist