Issue #1415 has been updated by [EMAIL PROTECTED]

After adding my own custom facts that use the non-truncatig
regexp, I found another problem: the ifconfig command, at least
in CentOS 5.2, reports the wrong MAC address for Infiniband
interfaces.  The proper way on modern Linuxes would be to read
/sys/class/net/*/address to get the MAC addresses.  (This *is* a
bug in ifconfig, but I think it would be good to use the proper
way anyway.  You would for example no longer be dependant on how
some command happens to format its output.)

Unfortunately, when I try to read /sys/class/net/.../address in
my custom fact, Puppet hangs.  Standalone facter works, but when
called from Puppet it doesn't work.  I'll try to debug this some
more.

----------------------------------------
Bug #1415: MAC addresses are truncated for Infiniband
http://reductivelabs.com/redmine/issues/show/1415

Author: [EMAIL PROTECTED]
Status: Unreviewed
Priority: Normal
Assigned to: 
Category: 
Target version: 
Keywords: 
Complexity: Easy
Patch: None


Facter (as of versions 1.3.8 and 1.5.0) assumes that MAC addresses
are always six octets.  That is not always the case, for example
if you have Infiniband interfaces:

# ifconfig ib0
ib0       Link encap:InfiniBand  HWaddr 
80:00:00:48:FE:80:00:00:00:00:00:00:00:00:00:00:00:00:00:00
          BROADCAST MULTICAST  MTU:2044  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:256
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

Facter truncates that address to six octets:

# pwd
/root/facter-1.5.0
# RUBYLIB=lib bin/facter | grep macaddress_ib0
macaddress_ib0 => 80:00:00:48:FE:80

The problem lies in the regexp parsing the output from ifconfig,
in lib/facter/macaddress.rb and in lib/facter/util/ip.rb:

/(?:ether|HWaddr) (\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2})/

for Linux, and slight variations for *BSD and SunOS.  It would
probably be better to use

    /(?:ether|HWaddr) ((\w{1,2}:){5,}\w{1,2})/

for this.



----------------------------------------
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://reductivelabs.com/redmine/my/account

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to