Bugs: Browse | Submit New | Admin

[#29113] macaddr does not retreive mac address under opensolaris

Date:
2011-04-04 11:39
Priority:
3
Submitted By:
gary mazz (garym)
Assigned To:
Nobody (None)
Category:
macaddr
State:
Open
Summary:
macaddr does not retreive mac address under opensolaris

Detailed description
OpenSolaris if config requires a '-a' option "ifconfig -a"

RuntimeError at /
all of /sbin/ifconfig /bin/ifconfig ifconfig ipconfig /all failed

    * file: macaddr.rb
    * location: addr
    * line: 49

#  /var/ruby/1.8/gem_home/gems/macaddr-1.0.0/lib/macaddr.rb in addr
#

  42.
  43. lines = nil
  44. cmds.each do |cmd|
  45. stdout = IO.popen("#{ cmd } 2> #{ null }"){|fd| fd.readlines} rescue next
  46. next unless stdout and stdout.size > 0
  47. lines = stdout and break
  48. end

  49. raise "all of #{ cmds.join ' ' } failed" unless lines

  50.
  51. candidates = lines.select{|line| line =~ re}
  52. raise 'no mac address candidates' unless candidates.first
  53. candidates.map!{|c| c[re].strip}
  54.
  55. maddr = candidates.first
  56. raise 'no mac address found' unless maddr

# /var/ruby/1.8/gem_home/gems/uuid-2.3.1/lib/uuid.rb in initialize
#

 201. @last_clock = (Time.now.to_f * CLOCK_MULTIPLIER).to_i
 202. @mutex = Mutex.new
 203.
 204. state_file = self.class.state_file
 205. if state_file && File.size?(state_file) then
 206. next_sequence
 207. else

 208. @mac = Mac.addr.gsub(/:|-/, '').hex & 0x7FFFFFFFFFFF

 209. fail "Cannot determine MAC address from any available interface, tried with #{Mac.addr}" if @mac == 0
 210. @sequence = rand 0x10000
 211.
 212. if state_file
 213. open_lock 'wb' do |io|
 214. write_state io
 215. end

#

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item