From: Marc Eshel Subject: Re: virtual hostname support for sm-notify on SuSE Date: Fri, 27 Jan 2006 18:31:32 -0800 Message-ID: <43DAD784.8050409@almaden.ibm.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Cc: okir@suse.de, mehta kiran , nfs@lists.sourceforge.net, nfs-admin@lists.sourceforge.net, Manoj Naik Return-path: To: Marc Eshel In-Reply-To: Sender: nfs-admin@lists.sourceforge.net Errors-To: nfs-admin@lists.sourceforge.net List-Unsubscribe: , List-Id: Discussion of NFS under Linux development, interoperability, and testing. List-Post: List-Help: List-Subscribe: , List-Archive: Here is the patch again from a mailer that doesn't change your text. Marc. --- sm-notify.c.orig 2006-01-27 16:58:47.913561080 -0800 +++ sm-notify.c 2006-01-27 16:59:11.855921288 -0800 @@ -183,12 +183,16 @@ notify(void) sin.sin_family = AF_INET; /* Bind source IP if provided on command line */ - if (opt_srcaddr - && inet_aton(opt_srcaddr, &sin.sin_addr) == 0) { - fprintf(stderr, - "Not a valid IP address: \"%s\"\n", - opt_srcaddr); - exit(1); + if (opt_srcaddr) { + struct hostent *hp = gethostbyname(opt_srcaddr); + if (hp) + sin.sin_addr = *(struct in_addr *)hp->h_addr; + else { + fprintf(stderr, + "Not a valid IP address: \"%s\"\n", + opt_srcaddr); + exit(1); + } } /* Use source port if provided on the command line, Marc Eshel wrote: >Hi Olaf >I asked for this fix a couple of years ago, here is the fix for this >problem. >Marc. > > >--- sm-notify.c.orig 2006-01-27 16:58:47.913561080 -0800 >+++ sm-notify.c 2006-01-27 16:59:11.855921288 -0800 >@@ -183,12 +183,16 @@ notify(void) > sin.sin_family = AF_INET; > > /* Bind source IP if provided on command line */ >- if (opt_srcaddr >- && inet_aton(opt_srcaddr, &sin.sin_addr) == 0) { >- fprintf(stderr, >- "Not a valid IP address: >\"%s\"\n", >- opt_srcaddr); >- exit(1); >+ if (opt_srcaddr) { >+ struct hostent *hp = >gethostbyname(opt_srcaddr); >+ if (hp) >+ sin.sin_addr = *(struct >in_addr *)hp->h_addr; >+ else { >+ fprintf(stderr, >+ "Not a >valid IP address: \"%s\"\n", >+ opt_srcaddr); >+ exit(1); >+ } > } > > /* Use source port if provided on the command line, > >------------------------------------------------------------------------------------------------------------------------------- >nfs-admin@lists.sourceforge.net wrote on 01/03/2006 10:02:44 PM: > > > >>Hi, >> I have noticed that >> sm-notify -v works >> while sm-notify -v does not work. >> Virtual name may be required if nfs server fails >> over across subnets. >> >> >>thanks, >> kiran >> >> > > > >>_______________________________________________ >>NFS maillist - NFS@lists.sourceforge.net >>https://lists.sourceforge.net/lists/listinfo/nfs >> >> > > > >------------------------------------------------------- >This SF.net email is sponsored by: Splunk Inc. Do you grep through log files >for problems? Stop! Download the new AJAX search engine that makes >searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! >http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 >_______________________________________________ >NFS maillist - NFS@lists.sourceforge.net >https://lists.sourceforge.net/lists/listinfo/nfs > > > ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ NFS maillist - NFS@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nfs