From owner-svn-src-all@freebsd.org Mon Jun 12 20:47:18 2017 Return-Path: Delivered-To: svn-src-all@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 63261C77CD8; Mon, 12 Jun 2017 20:47:18 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt0-x22a.google.com (mail-qt0-x22a.google.com [IPv6:2607:f8b0:400d:c0d::22a]) (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 0E4BB7E7F4; Mon, 12 Jun 2017 20:47:18 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt0-x22a.google.com with SMTP id w1so142139740qtg.2; Mon, 12 Jun 2017 13:47:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=DeuwvrVF/8AyruPsQ2BRPmeVE7jFMCIZMGXpTtXtpG4=; b=AglSIL5CR1tc5XXFegg4Acp/zIqcph65kPHP24VZi+mv8REtG9MfHY1ts/uu4M4mlM 5khk1MBvKAytaxkMQTuIUF9iVRzeLIpaTeDBW8/VtmgUCv+Fh5JDhxSEF5+ZE3pby7du cO7nH5mmLiSvo2Cj+3I4y5c0NeNN+ger8wlDjaFyGustlY9PPe4fKCuyqyp0JBGY2IO/ iU5adKR4iJiYCYQbbKO2gKz3+2BkPXX2v8jELWq+fx6GehA2pJRQiTKYe3tkmMuNPKaf 5Qo4oJqTpUH2sksgvgB88JY9vk/RDO9bQ2qzt/2SNXNcp3sJwZU8WaNFRP4XO6J/djSW lj9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=DeuwvrVF/8AyruPsQ2BRPmeVE7jFMCIZMGXpTtXtpG4=; b=FQVdFLymsNozFQHtlYt4S2iSiesuFFX+RCjEopMF7EdFK59Ib60k5z/18/c5oJpfgK 8yt9a2zDG1v9GdH2+X9D89GoR8NSv5l2lzVFpKvrJd08XzaDBi2j2fwimljoa/FcbvCD eYUtCWePljyO7tNcrMYbo+hSjZS2rFwCbWi23DXfKgTwXo6bThhx9IfgmHu8xWHzW8r0 /J/5v919fNwMM7KPfSzTKLoGogGNU7P8lYBSKDMZoyDEDF4o5sTepnVk9sy122dZC200 8kazq8mlQ3A7is8mtbS3gaDiig4pGl1TDmHucrDUKy7tvaunPVQi8n7DcWSvBRJnv+We ipcA== X-Gm-Message-State: AKS2vOwTW8MUvThPgC4puA9cpQ2H6fIaAO44efgxeS2bUxCmAQd/KqCE MJsWWiFg/2W7+FHF X-Received: by 10.55.88.194 with SMTP id m185mr70346839qkb.230.1497300437259; Mon, 12 Jun 2017 13:47:17 -0700 (PDT) Received: from wkstn-mjohnston.west.isilon.com (c-76-104-201-218.hsd1.wa.comcast.net. [76.104.201.218]) by smtp.gmail.com with ESMTPSA id e32sm6336076qte.1.2017.06.12.13.47.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Jun 2017 13:47:16 -0700 (PDT) Sender: Mark Johnston Date: Mon, 12 Jun 2017 13:47:05 -0700 From: Mark Johnston To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319868 - in head/sys: kern sys Message-ID: <20170612204704.GA73695@wkstn-mjohnston.west.isilon.com> References: <201706122014.v5CKEitK071089@repo.freebsd.org> <20170612202952.GU2088@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170612202952.GU2088@kib.kiev.ua> User-Agent: Mutt/1.8.2 (2017-04-18) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 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: Mon, 12 Jun 2017 20:47:18 -0000 On Mon, Jun 12, 2017 at 11:29:52PM +0300, Konstantin Belousov wrote: > On Mon, Jun 12, 2017 at 08:14:44PM +0000, Mark Johnston wrote: > > +int > > +uuidcmp(const struct uuid *uuid1, const struct uuid *uuid2) > > +{ > > + > > + return (memcmp(uuid1, uuid2, sizeof(struct uuid))); > > +} > > This is unsafe. The function operation depends on the ABI properties > that there is no padding either between members, or at the end of > the structure. Why not use by-member comparision ? I interpreted the CTASSERT at the beginning of kern_uuid.c as a guarantee that no such padding will be present. kern_uuid.c also defines an alternate representation, struct uuid_private, and casts between the two.