From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1aanGI-0002IB-H5 for mharc-grub-devel@gnu.org; Tue, 01 Mar 2016 11:35:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54629) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aanGF-0002DB-E6 for grub-devel@gnu.org; Tue, 01 Mar 2016 11:35:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aanGB-0000he-AM for grub-devel@gnu.org; Tue, 01 Mar 2016 11:34:59 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:47286) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aanGB-0000fa-2D for grub-devel@gnu.org; Tue, 01 Mar 2016 11:34:55 -0500 Received: from pps.filterd (m0044008.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.15.0.59/8.15.0.59) with SMTP id u21GXmJg002874; Tue, 1 Mar 2016 08:34:43 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fb.com; h=subject : to : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=facebook; bh=EOr7rYW/TGZlgK1K8HFlIQRe3Io56GxOBpItRuai+uA=; b=q8au04Vzeb0RKd9za0mv+KxIIfiT4zTFGPF1P+SEr5gZ81+xKqriNh6rud/gXK0nelDM iPhTpfcjxXaFozJyl9PBs/Y85vW13hdLAU+x3Ul1U+J9ZJ+h+99R9HxCPkOis9zA3B1b QKN75unuEhJCJT3SyRgFAX9ADtqiMCkbYW8= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 21ddvdr8fx-1 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Tue, 01 Mar 2016 08:34:43 -0800 Received: from localhost.localdomain (192.168.52.123) by mail.thefacebook.com (192.168.16.12) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 1 Mar 2016 08:34:38 -0800 Subject: Re: [PATCH] bootp: use the ipv* version given by the dhcp server To: Andrei Borzenkov , The development of GNU GRUB , References: <1456341036-13185-1-git-send-email-jbacik@fb.com> <56D1E583.3090705@gmail.com> From: Josef Bacik Message-ID: <56D5C49B.6060708@fb.com> Date: Tue, 1 Mar 2016 11:34:35 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <56D1E583.3090705@gmail.com> Content-Type: text/plain; charset="utf-8"; format=flowed X-Originating-IP: [192.168.52.123] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-03-01_09:, , signatures=0 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mx0a-00082601.pphosted.com id u21GXmJg002874 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 67.231.145.42 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, 01 Mar 2016 16:35:00 -0000 On 02/27/2016 01:05 PM, Andrei Borzenkov wrote: > 24.02.2016 22:10, Josef Bacik =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >> We were setting DNS_OPTION_PREVER_IPV* based on which version of the d= hcp >> 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 simpli= city 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 *ven= d, int limit, int *mask) >> struct grub_net_network_level_address s; >> s.type =3D GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; >> s.ipv4 =3D grub_get_unaligned32 (ptr); >> - s.option =3D DNS_OPTION_PREFER_IPV4; >> + s.option =3D DNS_OPTION_IPV4; >> grub_net_add_dns_server (&s); >> ptr +=3D 4; >> } >> @@ -492,7 +492,7 @@ get_dhcpv6_dns_address (const struct grub_net_dhcp= v6_packet *packet, >> (la + i)->type =3D GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; >> (la + i)->ipv6[0] =3D grub_get_unaligned64 (pa); >> (la + i)->ipv6[1] =3D grub_get_unaligned64 (pa + 8); >> - (la + i)->option =3D DNS_OPTION_PREFER_IPV6; >> + (la + i)->option =3D DNS_OPTION_IPV6; >> } >> >> *addr =3D 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. > No, the justification is that if you have ipv6 only systems=20 "PREFER_IPV6" isn't the appropriate behavior. The fact is you are only=20 going to get ipv6 dns servers from dhcpv6 responses and same for ipv4,=20 you don't want to "prefer", you want to bind it to the response you get=20 to avoid trying an incompatible ip version that you can't talk to. > 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". > The end result is the same, you can't talk to it. This is the same=20 behavior you get when you try to ping ipv6.google.com from a non-ipv6=20 system, it'll say it can't find the host, which is true, there is no way=20 we can talk to it so it can't see it. This isn't going to break=20 existing setups at all, it just removes unexpected behavior in mixed and=20 ipv6 only environments. Thanks, Josef