From owner-svn-src-all@freebsd.org Tue Aug 13 16:50:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 362C7B59DA; Tue, 13 Aug 2019 16:50:20 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 467JcD0fv0z45tw; Tue, 13 Aug 2019 16:50:19 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x434.google.com with SMTP id i30so3218000pfk.9; Tue, 13 Aug 2019 09:50:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=tjFMvSlWAi+N0HNGo3ey/1qIx2QM32Kuft6tri6p2+A=; b=BPW3u6Tsn5cfrk1VwRg9Z2T/kKGA7nqqLgB6gusmf9WKcDipXFdpZT/SmNY8maD6QU HbtDDLAhnZvkhN4rh5d86DGNoLEjZL2bZE6PQEvPOnxnhiRdiTJC0FXDpJ6Ng5/zVKL/ JkMaGhM9Du9fgRci6X5MvTlQIG3rPAdQXHiBSZ8CML5wVmfrb/j9R/px+bhcLyV1Q+Th AOccHn4QcGsdPPMMgIegvMJdH/zVvHx9n72AA0raC0EIa23g6A2EOQt+pREuiZs9bZid LVpDK45uBIE9IO1xJEfOKK8eH58tkoE/f2JEvDGzQqVCNwK2AKQE4EbJrjemwtQ9B6KH 9F1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=tjFMvSlWAi+N0HNGo3ey/1qIx2QM32Kuft6tri6p2+A=; b=d+9HXw3O4w/pytq7pOHQZr90CfDuo6smfrkXundtcBRd5YuVT239ey4o3XmXaARaAH SQYzdC1KzpkU3TMeoCE0VZJcCKcDkYfWOqY59By6Lwz0Op61RKb2xmGxQumAEELc5L7+ QrD8v8BATgoGfxoehRtclbyy1/8eqw0w8MSBwPFl2bnAZgGBNMtv74L+YN/6JNECfOdY 7IkHbSFfWBl8VILbSsbeaEBGYZMQPeLw8fCWpEt3kQrP1VQ0Nt9f7ZY7iamKBcJJaQMN Q4bMVs2YiZ0pVu4z5xBX6keGyW0pQZ0tdcnrDMwvC5foJxb9VbN84kOXbo1j18CYuuJp u+Dw== X-Gm-Message-State: APjAAAUnQ4BLLAuG+NlqXHajK9UfYneLhPCIgMuH8tld9Tm/MjLCQHVD +pxOvP39tb/RS1et2WNGweRkrODtgL8= X-Google-Smtp-Source: APXvYqz+9jHaqHgBlrVmv9p46zZhGcZLzn6HRQdxBreqrMZ7sCYqLONCADExWvr0lfmVwXPAR9YSmQ== X-Received: by 2002:a63:c203:: with SMTP id b3mr6172092pgd.450.1565715017830; Tue, 13 Aug 2019 09:50:17 -0700 (PDT) Received: from [192.168.20.12] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id m4sm128614725pgs.71.2019.08.13.09.50.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Aug 2019 09:50:16 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r350993 - head/sbin/ping6 From: "Enji Cooper (yaneurabeya)" In-Reply-To: <201908131622.x7DGMhUL047226@repo.freebsd.org> Date: Tue, 13 Aug 2019 09:50:14 -0700 Cc: src-committers , svn-src-all , svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201908131622.x7DGMhUL047226@repo.freebsd.org> To: Alan Somers X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: 467JcD0fv0z45tw X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 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: Tue, 13 Aug 2019 16:50:20 -0000 > On Aug 13, 2019, at 09:22, Alan Somers wrote: >=20 > Author: asomers > Date: Tue Aug 13 16:22:43 2019 > New Revision: 350993 > URL: https://svnweb.freebsd.org/changeset/base/350993 >=20 > Log: > Consistently use the byteorder functions in the correct direction >=20 > Though ntohs and htons are functionally identical, they have = different meanings.Using the correct one helps to document the code. This statement is only true for BE platforms. For LE platforms like = i386/x64, ntohs and htons actually does a endianness conversion: sys/powerpc/include/endian.h:#define __ntohs(x) = (__bswap16((__uint16_t)(x))) sys/powerpc/include/endian.h:#define __ntohs(x) = ((__uint16_t)(x)) sys/sparc64/include/endian.h:#define __ntohs(x) = ((__uint16_t)(x)) sys/x86/include/endian.h:#define __ntohs(x) __bswap16(x) sys/mips/include/endian.h:#define __ntohs(x) = ((__uint16_t)(x)) sys/mips/include/endian.h:#define __ntohs(x) (__bswap16((x))) sys/arm/include/endian.h:#define __ntohs(x) ((__uint16_t)(x)) sys/arm/include/endian.h:#define __ntohs(x) (__bswap16(x)) sys/arm64/include/endian.h:#define __ntohs(x) (__bswap16(x)) sys/riscv/include/endian.h:#define __ntohs(x) (__bswap16(x)) sys/sys/param.h:#define ntohs(x) __ntohs(x) sys/netinet/in.h:#define ntohs(x) __ntohs(x) Thanks, -Enji