[PATCH 7/8] net: dns: export resolved ip to var resolved_ip

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Fri Mar 30 06:16:52 EDT 2012


On 11:12 Fri 30 Mar     , Sascha Hauer wrote:
> On Fri, Mar 30, 2012 at 06:31:52AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > This will allow to use it in scripting.
> > 
> >  {
> >  	IPaddr_t ip;
> >  
> > +	setenv("resolved_ip", "");
> > +
> >  	if (argc != 2)
> >  		return COMMAND_ERROR_USAGE;
> >  
> > @@ -248,6 +251,7 @@ static int do_host(int argc, char *argv[])
> >  		printf("%s is at ", argv[1]);
> >  		print_IPaddr(ip);
> >  		printf("\n");
> > +		setenv_ip("resolved_ip", ip);
> 
> I smell complex environment scripts here. Maybe we should rather
> integrate dns into getenv_ip. This will help all commands using ip
> addresses instead of putting the burden of resolving a host name into
> the environment.

yeah didn't think about it

not really complex sript but bootp with tftp server with name instead of IP

Best Regards,
J.



More information about the barebox mailing list