From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Daniel P. Berrange" Subject: Re: [PATCH] vnclisten for HVM vnc Date: Fri, 29 Sep 2006 20:02:33 +0100 Message-ID: <20060929190233.GA8564@redhat.com> References: <20060927200239.GS20056@redhat.com> <3AAA99889D105740BE010EB6D5A5A3B202A417@paddington.ad.cl.cam.ac.uk> <20060929172401.GB9351@redhat.com> <451D5FD6.7090307@us.ibm.com> Reply-To: "Daniel P. Berrange" Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <451D5FD6.7090307@us.ibm.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Anthony Liguori Cc: Ian Pratt , xen-devel , Jeremy Katz List-Id: xen-devel@lists.xenproject.org On Fri, Sep 29, 2006 at 01:03:02PM -0500, Anthony Liguori wrote: > > > >+int parse_host(struct sockaddr_in *saddr, const char *buf) > >+{ > >+ struct hostent *he; > >+ > >+ if (isdigit(buf[0])) { > >+ if (!inet_aton(buf, &saddr->sin_addr)) > >+ return -1; > > > > Valid hostnames can begin with a digit as long as there are non-digits > in the name. What I normally do is try inet_aton() iff gethostbyname > fails first. Yeah, should have thought about possibility of using a hostname instead of IP address. Will update the patch to try what you suggest here. We've also got an equivalent patch for the para-virt framebuffer which I'll post later too. Regards, Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|