2006-01-04 06:02:54

by mehta kiran

[permalink] [raw]
Subject: virual hostname support for sm-notify on SuSE

Hi,
I have noticed that
sm-notify -v <virtual ip> works=20
while sm-notify -v <virtual name> does not work.
Virtual name may be required if nfs server fails=20
over across subnets.
=20

thanks,
kiran


=09
__________________________________________=20
Yahoo! DSL =96 Something to write home about.=20
Just $16.99/mo. or less.=20
dsl.yahoo.com=20



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi=
les
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs


2006-01-28 02:21:59

by Marc Eshel

[permalink] [raw]
Subject: Re: virtual hostname support for sm-notify on SuSE

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,

-------------------------------------------------------------------------------------------------------------------------------
[email protected] wrote on 01/03/2006 10:02:44 PM:

> Hi,
> I have noticed that
> sm-notify -v <virtual ip> works
> while sm-notify -v <virtual name> does not work.
> Virtual name may be required if nfs server fails
> over across subnets.
>
>
> thanks,
> kiran

> _______________________________________________
> NFS maillist - [email protected]
> 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 - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2006-01-28 02:31:32

by Marc Eshel

[permalink] [raw]
Subject: Re: virtual hostname support for sm-notify on SuSE

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,
>
>-------------------------------------------------------------------------------------------------------------------------------
>[email protected] wrote on 01/03/2006 10:02:44 PM:
>
>
>
>>Hi,
>> I have noticed that
>> sm-notify -v <virtual ip> works
>> while sm-notify -v <virtual name> does not work.
>> Virtual name may be required if nfs server fails
>> over across subnets.
>>
>>
>>thanks,
>> kiran
>>
>>
>
>
>
>>_______________________________________________
>>NFS maillist - [email protected]
>>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 - [email protected]
>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 - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2006-01-30 09:56:52

by Olaf Kirch

[permalink] [raw]
Subject: Re: virtual hostname support for sm-notify on SuSE

Hi Marc,

I don't remember seeing that request, sorry.

SLES10 will have a fix for this (which uses getaddrinfo rather than
gethostbyname, but otherwise it should work the same way as your patch)

Thanks,
Olaf
--
Olaf Kirch | --- o --- Nous sommes du soleil we love when we play
[email protected] | / | \ sol.dhoop.naytheet.ah kin.ir.samse.qurax


-------------------------------------------------------
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 - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs