Skip to contentSkip to conversation

virual hostname support for sm-notify on SuSE

DISCUSSION mehta kiran 3 participants 4 messages Jan 4, 2006 – Jan 30, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

#1 lore raw

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 2006-01-27 16:59:11.855921288 -0800 renamed from sm-notify.c.orig 2006-01-27 16:58:47.913561080 -0800 +2 -6
@@ -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:

Quoted 8 lines

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.

Quoted 6 lines

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

#2 lore raw

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 renamed from sm-notify.c.orig +0 -0
@@ -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,
Quoted 62 lines · Marc Eshel

Hi Olaf I asked for this fix a couple of years ago, here is the fix for this problem. Marc.

sm-notify.c 2006-01-27 16:59:11.855921288 -0800 renamed from sm-notify.c.orig 2006-01-27 16:58:47.913561080 -0800 +7 -6
@@ -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);

sm-notify.c 2006-01-27 16:59:11.855921288 -0800 renamed from sm-notify.c.orig 2006-01-27 16:58:47.913561080 -0800 +2 -1
+                                                exit(1);
+                                }
                }
 
                /* Use source port if provided on the command line,
 
-------------------------------------------------------------------------------------------------------------------------------

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

Quoted 15 lines

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

Quoted 5 lines

_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

Quoted 11 lines

-------------------------------------------------------
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

#3 lore raw

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

Signature · 12 lines
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