grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DNS endianness


From: Colin Watson
Subject: Re: DNS endianness
Date: Tue, 23 Sep 2014 20:07:40 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

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                                       address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]