All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josef Bacik <jbacik@fb.com>
To: Andrei Borzenkov <arvidjaar@gmail.com>,
	The development of GNU GRUB <grub-devel@gnu.org>,
	<kernel-team@fb.com>
Subject: Re: [PATCH] bootp: use the ipv* version given by the dhcp server
Date: Tue, 1 Mar 2016 11:34:35 -0500	[thread overview]
Message-ID: <56D5C49B.6060708@fb.com> (raw)
In-Reply-To: <56D1E583.3090705@gmail.com>

On 02/27/2016 01:05 PM, Andrei Borzenkov wrote:
> 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 <jbacik@fb.com>
>> ---
>>   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.
>

No, the justification is that if you have ipv6 only systems 
"PREFER_IPV6" isn't the appropriate behavior.  The fact is you are only 
going to get ipv6 dns servers from dhcpv6 responses and same for ipv4, 
you don't want to "prefer", you want to bind it to the response you get 
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 
behavior you get when you try to ping ipv6.google.com from a non-ipv6 
system, it'll say it can't find the host, which is true, there is no way 
we can talk to it so it can't see it.  This isn't going to break 
existing setups at all, it just removes unexpected behavior in mixed and 
ipv6 only environments.  Thanks,

Josef


  reply	other threads:[~2016-03-01 16:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-24 19:10 [PATCH] bootp: use the ipv* version given by the dhcp server Josef Bacik
2016-02-27 18:05 ` Andrei Borzenkov
2016-03-01 16:34   ` Josef Bacik [this message]
2016-03-01 19:35     ` Andrei Borzenkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56D5C49B.6060708@fb.com \
    --to=jbacik@fb.com \
    --cc=arvidjaar@gmail.com \
    --cc=grub-devel@gnu.org \
    --cc=kernel-team@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.