Thread

Posted on Tue Jul 11 21:27:15 2006 by cmv
Fails on SunOS with non-fully-qualified NODENAME
Martin-
Thanks for the quick fix for the PATH problem. Here is another suggestion.

On Sun workstations, if you set your name by using a non-Fully-Qualified-Domain-Name (FQDN) in the /etc/nodename file, then Net::Address::Ethernet will fail doing the arp, since the arp table has FQDNs in it.
As an example: /etc/nodename contains "snoopy" $ arp snoopy snoopy (192.11.45.19) -- no entry $ arp snoopy.myfqdn.com snoopy.myfqdn.com (123.45.67.89) at 1:2:3:4:5 permanent published

Many folks use non-FQDNs this way when they want to use dhcp to acquire an IP address, and have their nodename used on whatever domain they plug into.

The fix for this should be pretty easy. Instead of using Sys::Hostname to get the hostname, I would suggest using Net::Domain.
Here's a quick example: $ perl -e 'use Net::Domain hostfqdn; print hostfqdn(),"\n"' snoopy.myfqdn.com
I don't know if this would break anything on other platforms though.
Direct Responses: 2624 | Write a response
Posted on Fri Jul 14 18:40:45 2006 by cmv in response to 2611
Re: Fails on SunOS with non-fully-qualified NODENAME
Martin- A quick followup on changing Net::Address::Ethernet to use Net::Domain for the hostname, based on my trial modifications of your module:

1.) Depending on configuration, you'll want to do an arp on BOTH the fully qualified and non-fully qualified domain name. The Net::Domain package has both the hostname and hostfqdn calls, which should provide both.

2.) I think you'll want to change your code to try one first, and if that fails, then try the other. On my implementation, I noticed that you saw the STDERR error message when arp fails. I don't know if you want to try and hide that or not.

3.) My implementation went something like this:
my @as = qx{ $ARP hostname }; if($?) { @as = qx{ $ARP hostfqdn }; }

Hope this helps. -Craig
Direct Responses: 2626 | Write a response
Posted on Sat Jul 15 15:42:27 2006 by mthurn in response to 2624
Re: Fails on SunOS with non-fully-qualified NODENAME
Good ideas, thank you. I made some changes but won't be able to test it on Solaris/Linux until Monday at work.
Write a response