grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] bootp: use the ipv* version given by the dhcp server


From: Andrei Borzenkov
Subject: Re: [PATCH] bootp: use the ipv* version given by the dhcp server
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

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



reply via email to

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