From owner-svn-src-all@FreeBSD.ORG Sat Oct 19 20:11:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CB825A6E; Sat, 19 Oct 2013 20:11:39 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qe0-x22f.google.com (mail-qe0-x22f.google.com [IPv6:2607:f8b0:400d:c02::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 54BB72E68; Sat, 19 Oct 2013 20:11:39 +0000 (UTC) Received: by mail-qe0-f47.google.com with SMTP id b4so2830908qen.20 for ; Sat, 19 Oct 2013 13:11:38 -0700 (PDT) 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=OrFUTupacEYVK5xhalBon/tVYsoX2YZBVhMxLQ/ruOI=; b=y2thGrfbJWknX03c//J5y3XIL5PkOd4YlsnKRfu2kk7SLaRVkAVRukBXY/co/5MhIZ 2fq4J2E4G1FF5hw6ubENvSHp5/1Jock4iY2W9vJmPMAtt3/aoa+2dmNBCdliFtbun28W +3Fqv/SsAj9IttOdOxfT51Hhx1yHEJ+n1hLlKXOjjq++xtQ5oTlPIgI/lDZkYmti8Lcd v/YNXv9nI4VvjrmFMOP4+4X7QmtxrFiMZu9p7gyEo3tWaVE/fWZWFL3i4zKuvAq3lOGz Hi3gs69Y3QAxBWDy6UNzg6zQWYOuEWkOC7a1wOtEGxZlQkD6pNv2gp00SR4EX571l7ZT Mowg== MIME-Version: 1.0 X-Received: by 10.224.36.201 with SMTP id u9mr13180903qad.76.1382213498477; Sat, 19 Oct 2013 13:11:38 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.207.66 with HTTP; Sat, 19 Oct 2013 13:11:38 -0700 (PDT) In-Reply-To: <201310190959.r9J9xBI1036988@svn.freebsd.org> References: <201310190959.r9J9xBI1036988@svn.freebsd.org> Date: Sat, 19 Oct 2013 13:11:38 -0700 X-Google-Sender-Auth: 6h_Jk1eoVx8RjOI37wcRO3cw1No Message-ID: Subject: Re: svn commit: r256768 - head/sbin/ifconfig From: Adrian Chadd To: =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Oct 2013 20:11:39 -0000 ... erm, this could break many existing scripts that stupidly(!) just try adding an interface to a group to see if it's already there. Is the ifconfig error behavour in this instance documented anywhere? -adrian On 19 October 2013 02:59, Dag-Erling Sm=F8rgrav wrote: > Author: des > Date: Sat Oct 19 09:59:11 2013 > New Revision: 256768 > URL: http://svnweb.freebsd.org/changeset/base/256768 > > Log: > Do not error out when adding an interface to a group to which it > already belongs or removing it from a group to which it does not > belong. This makes it possible to include group memberships in > ifconfig_foo0 in rc.conf without fear of breaking "service netif > restart foo0". > > MFC after: 3 days > > Modified: > head/sbin/ifconfig/ifgroup.c > > Modified: head/sbin/ifconfig/ifgroup.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sbin/ifconfig/ifgroup.c Sat Oct 19 09:40:29 2013 > (r256767) > +++ head/sbin/ifconfig/ifgroup.c Sat Oct 19 09:59:11 2013 > (r256768) > @@ -57,7 +57,7 @@ setifgroup(const char *group_name, int d > > if (strlcpy(ifgr.ifgr_group, group_name, IFNAMSIZ) >=3D IFNAMSIZ) > errx(1, "setifgroup: group name too long"); > - if (ioctl(s, SIOCAIFGROUP, (caddr_t)&ifgr) =3D=3D -1) > + if (ioctl(s, SIOCAIFGROUP, (caddr_t)&ifgr) =3D=3D -1 && errno != =3D > EEXIST) > err(1," SIOCAIFGROUP"); > } > > @@ -75,7 +75,7 @@ unsetifgroup(const char *group_name, int > > if (strlcpy(ifgr.ifgr_group, group_name, IFNAMSIZ) >=3D IFNAMSIZ) > errx(1, "unsetifgroup: group name too long"); > - if (ioctl(s, SIOCDIFGROUP, (caddr_t)&ifgr) =3D=3D -1) > + if (ioctl(s, SIOCDIFGROUP, (caddr_t)&ifgr) =3D=3D -1 && errno != =3D > ENOENT) > err(1, "SIOCDIFGROUP"); > } > >