# File lib/facter/util/ip.rb, line 143
143:   def self.get_interface_value(interface, label)
144:     tmp1 = []
145: 
146:     kernel = Facter.value(:kernel).downcase.to_sym
147: 
148:     # If it's not directly in the map or aliased in the map, then we don't know how to deal with it.
149:     unless map = REGEX_MAP[kernel] || REGEX_MAP.values.find { |tmp| tmp[:aliases] and tmp[:aliases].include?(kernel) }
150:       return []
151:     end
152: 
153:     # Pull the correct regex out of the map.
154:     regex = map[label.to_sym]
155: 
156:     # Linux changes the MAC address reported via ifconfig when an ethernet interface
157:     # becomes a slave of a bonding device to the master MAC address.
158:     # We have to dig a bit to get the original/real MAC address of the interface.
159:     bonddev = get_bonding_master(interface)
160:     if label == 'macaddress' and bonddev
161:       bondinfo = IO.readlines("/proc/net/bonding/#{bonddev}")
162:       hwaddrre = /^Slave Interface: #{interface}\n[^\n].+?\nPermanent HW addr: (([0-9a-fA-F]{2}:?)*)$/m
163:       value = hwaddrre.match(bondinfo.to_s)[1].upcase
164:     else
165:       output_int = get_output_for_interface_and_label(interface, label)
166: 
167:       output_int.each_line do |s|
168:         if s =~ regex
169:           value = $1
170:             if label == 'netmask' && convert_from_hex?(kernel)
171:               value = value.scan(/../).collect do |byte| byte.to_i(16) end.join('.')
172:             end
173:           tmp1.push(value)
174:         end
175:       end
176: 
177:       if tmp1
178:         value = tmp1.shift
179:       end
180:     end
181:   end