From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1XWVRR-0004Mq-A8 for mharc-grub-devel@gnu.org; Tue, 23 Sep 2014 15:08:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54114) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWVRO-0004MK-Sy for grub-devel@gnu.org; Tue, 23 Sep 2014 15:07:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XWVRN-0002H8-N5 for grub-devel@gnu.org; Tue, 23 Sep 2014 15:07:58 -0400 Received: from b.painless.aa.net.uk ([2001:8b0:0:30::51bb:1e34]:35423 helo=b.b.painless.aa.net.uk) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWVRN-0002FZ-HO for grub-devel@gnu.org; Tue, 23 Sep 2014 15:07:57 -0400 Received: from 3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.4.1.b.e.2.f.f.b.0.b.8.0.1.0.0.2.ip6.arpa ([2001:8b0:bff2:eb14::3] helo=riva.pelham.vpn.ucam.org) by b.painless.aa.net.uk with esmtps (TLSv1:AES128-SHA:128) (Exim 4.72) (envelope-from ) id 1XWVR8-0008CQ-SN for grub-devel@gnu.org; Tue, 23 Sep 2014 20:07:50 +0100 Received: from ns1.pelham.vpn.ucam.org ([172.20.153.2] helo=riva.ucam.org) by riva.pelham.vpn.ucam.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1XWVR7-00020B-Th for grub-devel@gnu.org; Tue, 23 Sep 2014 20:07:41 +0100 Date: Tue, 23 Sep 2014 20:07:40 +0100 From: Colin Watson To: grub-devel@gnu.org Subject: Re: DNS endianness Message-ID: <20140923190740.GA7552@riva.ucam.org> References: <20140922205325.132df618@opensuse.site> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140922205325.132df618@opensuse.site> User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:0:30::51bb:1e34 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 19:08:00 -0000 On Mon, Sep 22, 2014 at 08:53:25PM +0400, Andrei Borzenkov wrote: > This does not sound right ... > > static grub_err_t > recv_hook (grub_net_udp_socket_t sock __attribute__ ((unused)), > struct grub_net_buff *nb, > void *data_) > { > ... > head = (struct dns_header *) nb->data; > ... > for (i = 0; i < grub_cpu_to_be16 (head->qdcount); i++) > { > > We sure want to convert *to* cpu, not *from* cpu here? Same in all > other places in this function. The operations are precisely synonymous in all cases, so you should just use whichever spelling is clearest. -- Colin Watson [cjwatson@ubuntu.com]