lib/macaddr.rb in macaddr-1.7.1 vs lib/macaddr.rb in macaddr-1.7.2

- old
+ new

@@ -22,19 +22,19 @@ require 'systemu' require 'socket' module Mac - VERSION = '1.7.1' + VERSION = '1.7.2' def Mac.version ::Mac::VERSION end def Mac.dependencies { - 'systemu' => [ 'systemu' , '~> 2.6.2' ] + 'systemu' => [ 'systemu' , '~> 2.6.5' ] } end def Mac.description 'cross platform mac address determination for ruby' @@ -81,10 +81,12 @@ def from_getifaddrs return unless Socket.respond_to? :getifaddrs interfaces = Socket.getifaddrs.select do |addr| - addr.addr.pfamily == INTERFACE_PACKET_FAMILY + if addr.addr # Some VPN ifcs don't have an addr - ignore them + addr.addr.pfamily == INTERFACE_PACKET_FAMILY + end end mac, = if Socket.const_defined? :PF_LINK then interfaces.map do |addr|