From owner-freebsd-net@freebsd.org Wed Feb 10 18:18:16 2016 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FDFCAA4288 for ; Wed, 10 Feb 2016 18:18:16 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: from mail-vk0-x22e.google.com (mail-vk0-x22e.google.com [IPv6:2607:f8b0:400c:c05::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 07F7B11E5 for ; Wed, 10 Feb 2016 18:18:16 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: by mail-vk0-x22e.google.com with SMTP id e185so19576109vkb.1 for ; Wed, 10 Feb 2016 10:18:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=nTHgVI3jiZCbA8rmqb2j/c7joVv+sLNqI9S4tcJPPTo=; b=yzj9M3M5H5IGPjaEF3uW7ZTjU4uHqjIOCXfrKNbmKLcPIFrD59qMVsDl0UOFJ8uVQa Hxdu0wTsOOtkOLYVp7Tizye0/gGVz+vhcBB6ngtklX0/ns1FMyodtC/Y7m+bP6Y5B+FY xH6OMz4D9hPlL/Ff0D8y1FmhtG1s3zRQ8ZqitcTC6ecj0ZO+TFI+hM4/14qtK1vxRmIY ac5sGehpewr1iuxHmX5DwS/QUyMvTpk3lRBNSDCFDNAVTMCbpc4QRb29kGwxo9hXxIW3 1Z97rdHtyDaySeZ9/r5whjaAozvGHBJbpwYSY850jb9P+oE11yzCHh6Z6Nuq9ttIYVai 6VUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=nTHgVI3jiZCbA8rmqb2j/c7joVv+sLNqI9S4tcJPPTo=; b=kLbRkHKNiS0jOYRjX8z4cgwhzWlEl6LdAPVRd/rJhODQEj1UlQ14NGjxK3++1O+Czp Ei9J19p1S+tDEhikh/Uqxis472DfeuPW+1nDfp5CjaATofAqhKXcfI+EB2SYAGeNwe5A 06n27ZP/QxBf6lljLMGMB0y+wxwn9dsin8JkLJ1Nalik70mmk7bJFXfqVpb7GqFEKkSN 6yFSSlVJDr96o5apI/PArE12n5nK7LaytJJHQ/bHPtOA4t/JBgL/SpPvXndRsbIX4XI8 ZIB+E/kKRqiU+wV/CJZACnTBQ8nuASlbYua0pH2tMBqlCce6pNGde2C8gctRZkydtLEg xBHw== X-Gm-Message-State: AG10YOQRd/YiqD4opjR+nSjRswKuskuyDaPyYKXlxXDkfdrlSfZHsEKPUlzxTRmNJko6a59PMScUNUZtTnBtMQ== MIME-Version: 1.0 X-Received: by 10.31.133.7 with SMTP id h7mr30863367vkd.32.1455128294934; Wed, 10 Feb 2016 10:18:14 -0800 (PST) Sender: kob6558@gmail.com Received: by 10.159.32.135 with HTTP; Wed, 10 Feb 2016 10:18:14 -0800 (PST) In-Reply-To: <56BAF38B.3080809@grosbein.net> References: <76A08658-ACD2-426B-865A-45A6A79BBFB4@jboy.eu> <56BAF38B.3080809@grosbein.net> Date: Wed, 10 Feb 2016 10:18:14 -0800 X-Google-Sender-Auth: Ux5BN9kGFh7VdRMOe4yAXfVNn-U Message-ID: Subject: Re: ifconfig with quoted arguments From: Kevin Oberman To: Eugene Grosbein Cc: Jeremy Boy , "freebsd-net@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 18:18:16 -0000 On Wed, Feb 10, 2016 at 12:23 AM, Eugene Grosbein wrote: > On 10.02.2016 04:51, Jeremy Boy wrote: > > Hello list, > > > > please CC me in replies to this mail, since I am no subscriber to this > list. > > > > For safety reasons, we enclose user input to shell commands in quotes. > Until today, the resulting command for ifconfig(8) looked like this: > > > >> ifconfig ue0 inet "192.168.2.176 netmask 255.255.255.0" > > According to ifconfig(8) manual page, this syntax is wrong. > > > What exactly does ifconfig do? It seems to me that it reads the IP > address from the quoted string but truncates the netmask. Is this a bug in > ifconfig or intended behavior? > > The word "inet" is for "address_family". The next argument should be > "address" and > you supply "192.168.2.176 netmask 255.255.255.0" for "address". > It seems, ifconfig passes this argument to inet_aton() function that > parses IP address > and ignores first space and the rest of string. > I'd suggest using CIDR notation and eliminating the old "netmask" al together. ifconfig ue0 inet 192.168.2.176/24 Aside form no longer using a form of addressing that had been obsolete for 20 years, quotation marks won't matter. -- Kevin Oberman, Part time kid herder and retired Network Engineer E-mail: rkoberman@gmail.com PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683