From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1aYepn-0007qL-5U for mharc-grub-devel@gnu.org; Wed, 24 Feb 2016 14:10:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYepk-0007oe-GZ for grub-devel@gnu.org; Wed, 24 Feb 2016 14:10:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYepf-0005Iv-Dg for grub-devel@gnu.org; Wed, 24 Feb 2016 14:10:48 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:33069) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYepe-0005IY-Vy for grub-devel@gnu.org; Wed, 24 Feb 2016 14:10:43 -0500 Received: from pps.filterd (m0044010.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.15.0.59/8.15.0.59) with SMTP id u1OJADph028704 for ; Wed, 24 Feb 2016 11:10:41 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fb.com; h=from : to : subject : date : message-id : mime-version : content-type; s=facebook; bh=A40hFoDhE6NYmB3IS3Ay4zbcwv0Kn2Ui6WS8D4c5reM=; b=eTsuCRTnhYdSw4AOs7UhEmpXwaMtTCXbOhdkRG9S+P9nNlbqPl794EUYpZjAbluKY+Ef UNqfsqd2IWKjH+DaCrXabuCBVe4eLik1qk54xrJzUqJuwNZAMkVFjWMAwswOQjCKQ70d Ymi4cdi2a3RowrEF4lig4Rhsrss1QTxQMAM= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 219fgv93yr-1 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT) for ; Wed, 24 Feb 2016 11:10:41 -0800 Received: from localhost (192.168.52.123) by mail.thefacebook.com (192.168.16.22) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 24 Feb 2016 11:10:38 -0800 From: Josef Bacik To: , Subject: [PATCH] bootp: use the ipv* version given by the dhcp server Date: Wed, 24 Feb 2016 14:10:36 -0500 Message-ID: <1456341036-13185-1-git-send-email-jbacik@fb.com> X-Mailer: git-send-email 2.5.0 MIME-Version: 1.0 Content-Type: text/plain 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-02-24_10:, , signatures=0 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: Wed, 24 Feb 2016 19:10:49 -0000 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; -- 2.5.0