From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1aZjFk-0008Mb-1K for mharc-grub-devel@gnu.org; Sat, 27 Feb 2016 13:06:04 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48394) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZjFh-0008KF-BB for grub-devel@gnu.org; Sat, 27 Feb 2016 13:06:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aZjFe-0001ub-5f for grub-devel@gnu.org; Sat, 27 Feb 2016 13:06:01 -0500 Received: from mail-lb0-x22c.google.com ([2a00:1450:4010:c04::22c]:33113) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZjFd-0001uX-UE for grub-devel@gnu.org; Sat, 27 Feb 2016 13:05:58 -0500 Received: by mail-lb0-x22c.google.com with SMTP id ep2so29493842lbb.0 for ; Sat, 27 Feb 2016 10:05:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=ELtRKZT+MUmVNXT/OOaXl8FknLXmLLvxT6zuxhLoSxs=; b=zm7oVR74GF5lX7oDEEnxxnR07athqHVgeMTgcfNI1nflWm0E2MAfK0/pD76rbneaLP A+ID1XXKQH1/6NDM2LEupy2PqwoFWkT/rk/jcQ7fVeIQ+Cml8U0abSb0Vjoa6zuU/PL7 rB73uTrBop/QkUNQYVrJjBJ49BxteOP0Sl2wzRlr0kXqvuOPh190sndMGoWKyRWaPH1V 6lUmiRId2kXtl+kmiKdRvV9alKOIpj8XxwGNAGSETbk45T6BVLA4YcDTeUFdp9nwubJf NMuBRz+SpjvWccWvDI7lerI+C8NX3DtqUiBNxjEkqwcsj+hI4r5+Df0DVEQsp5LJHWBe /MIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=ELtRKZT+MUmVNXT/OOaXl8FknLXmLLvxT6zuxhLoSxs=; b=QC6YU3r2A7AQ8v3ksbsTQpujf3y42DHQLtqCSfXSrGbblcVaWLgOHCa1KTD7rcqjYQ UK28NvaPSE531lIgwW7kDQTzvnIXP7vp060eapzYO8rGkZO4EWnPG5QwNxHYvGoAFaSW CUMmZKFMU6OtRJ6mSxBOoHzw4zA2YNxbeQHAbL0nNQUBTOo8xFl6Po2z2MSKWpuWkf2f lYDnRSH1HQoB9iLnpxp5E7FNX80fkZRnyRsb88526K5BkR3AvPsiFoJOkH1CvPgsYrEE KACu/0nmGPrScD8LcndoKYx35HD5zfSj88Hx/HC457Qw/e4ieSOK/fbE+juEOYezyl+F qROw== X-Gm-Message-State: AD7BkJLFwJVPULJmqLC+r5a8SU/yuV9snG9Tu1Ha605gXREuT9/vhPmqupoEp7B6M+QdPg== X-Received: by 10.113.4.133 with SMTP id ce5mr2679348lbd.114.1456596357188; Sat, 27 Feb 2016 10:05:57 -0800 (PST) Received: from [192.168.1.41] (ppp109-252-76-159.pppoe.spdop.ru. [109.252.76.159]) by smtp.gmail.com with ESMTPSA id pm9sm2559511lbb.25.2016.02.27.10.05.55 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 27 Feb 2016 10:05:56 -0800 (PST) Subject: Re: [PATCH] bootp: use the ipv* version given by the dhcp server To: The development of GNU GRUB , kernel-team@fb.com References: <1456341036-13185-1-git-send-email-jbacik@fb.com> From: Andrei Borzenkov X-Enigmail-Draft-Status: N1110 Message-ID: <56D1E583.3090705@gmail.com> Date: Sat, 27 Feb 2016 21:05:55 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1456341036-13185-1-git-send-email-jbacik@fb.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c04::22c 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: Sat, 27 Feb 2016 18:06:02 -0000 24.02.2016 22:10, Josef Bacik пишет: > We were setting DNS_OPTION_PREVER_IPV* based on which version of the dhcp > request we go back. However this would mean that we would mistakenly fall back > on ipv4 in an ipv6 only system, or vice versa. For the sake of simplicity lets > only use the ip version for the dns server we got in our dhcp response. Thanks, > > Signed-off-by: Josef Bacik > --- > grub-core/net/bootp.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c > index 345ad7a..cde818c 100644 > --- a/grub-core/net/bootp.c > +++ b/grub-core/net/bootp.c > @@ -95,7 +95,7 @@ parse_dhcp_vendor (const char *name, const void *vend, int limit, int *mask) > struct grub_net_network_level_address s; > s.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; > s.ipv4 = grub_get_unaligned32 (ptr); > - s.option = DNS_OPTION_PREFER_IPV4; > + s.option = DNS_OPTION_IPV4; > grub_net_add_dns_server (&s); > ptr += 4; > } > @@ -492,7 +492,7 @@ get_dhcpv6_dns_address (const struct grub_net_dhcpv6_packet *packet, > (la + i)->type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; > (la + i)->ipv6[0] = grub_get_unaligned64 (pa); > (la + i)->ipv6[1] = grub_get_unaligned64 (pa + 8); > - (la + i)->option = DNS_OPTION_PREFER_IPV6; > + (la + i)->option = DNS_OPTION_IPV6; > } > > *addr = la; > that's pretty radical behavior change. It may break existing configuration. As the only justification is side stepping issues in current DNS implementation I think we should rather fix implementation. And even if it does not break things knowing that host has "other" IP and additional interface may be needed is IMHO more useful than getting confusing "host does not exist".