[klibc] [PATCH] Don't try to guess the nameserver in ipconfig.

maximilian attems max at stro.at
Wed Jun 15 09:16:41 PDT 2011


On Wed, 08 Jun 2011, Ulrich Dangel wrote:

> klibcs ipconfig tries to guess the nameserver if no nameserver is
> provided. This may happen due to misconfigured dhcp or the use of
> the ip= parameter.
> 
> This patch removes the guessing from ipconfig as it is not possible for
> any other script to determine if the provided nameserver is valid or
> a guessed one. If the old behavior is really needed this could be easily
> implemented in an external script.
> 
> Closes: #594638
> 
> Signed-off-by: Ulrich Dangel <uli at spamt.net>

have to check older linux <= 2.0, haven't seen this guessing
in any newer ones.

Your analysis shows that  ip_nameserver is unused outside of ipconfig,
nor any sign of gethostbyname() or such. mount.c doesn't do dns resolving,
so I'd guess your patch is a welcome fix for 
http://bugs.debian.org/594638

> ---
>  usr/kinit/ipconfig/main.c |    5 -----
>  1 files changed, 0 insertions(+), 5 deletions(-)
> 
> diff --git a/usr/kinit/ipconfig/main.c b/usr/kinit/ipconfig/main.c
> index 4833bb7..0fd35c1 100644
> --- a/usr/kinit/ipconfig/main.c
> +++ b/usr/kinit/ipconfig/main.c
> @@ -176,11 +176,6 @@ static void postprocess_device(struct netdev *dev)
>  		printf("IP-Config: %s guessed broadcast address %s\n",
>  		       dev->name, my_inet_ntoa(dev->ip_broadcast));
>  	}
> -	if (dev->ip_nameserver[0] == INADDR_ANY) {
> -		dev->ip_nameserver[0] = dev->ip_server;
> -		printf("IP-Config: %s guessed nameserver address %s\n",
> -		       dev->name, my_inet_ntoa(dev->ip_nameserver[0]));
> -	}
>  }
>  
>  static void complete_device(struct netdev *dev)
> -- 
> 1.7.1
> 
-- 
maks



More information about the klibc mailing list