mirror of
https://github.com/bobbimanners/emailler.git
synced 2024-10-08 22:54:40 +00:00
git-svn-id: http://svn.code.sf.net/p/netboot65/code@135 93682198-c243-4bdb-bd91-e943c89aac3b
This commit is contained in:
parent
6e6137c60d
commit
eade2778dd
@ -59,15 +59,21 @@ end
|
|||||||
option_length=offsets[1]
|
option_length=offsets[1]
|
||||||
|
|
||||||
if option_length==6 then
|
if option_length==6 then
|
||||||
split_values=value.split(":")
|
if value.downcase=="auto" then
|
||||||
if (split_values.length!=6) || (split_values[5].nil?) then
|
require 'digest/md5'
|
||||||
puts "'#{value}' is not a valid MAC address. (e.g. 12:34:56:78:ab:cd)"
|
digest = Digest::MD5.digest(Time.now.to_s)
|
||||||
exit
|
mac=[0x00,0x80,0x10,digest[0],digest[1],Kernel.rand(255)]
|
||||||
end
|
else
|
||||||
mac=[]
|
split_values=value.split(":")
|
||||||
6.times do |j|
|
if (split_values.length!=6) || (split_values[5].nil?) then
|
||||||
mac[j]=split_values[j].hex
|
puts "'#{value}' is not a valid MAC address. (e.g. 12:34:56:78:ab:cd)"
|
||||||
# puts "#{split_values[j]}->#{"%02X" % mac[j]}"
|
exit
|
||||||
|
end
|
||||||
|
mac=[]
|
||||||
|
6.times do |j|
|
||||||
|
mac[j]=split_values[j].hex
|
||||||
|
# puts "#{split_values[j]}->#{"%02X" % mac[j]}"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
packed_option=mac.pack("cccccc")
|
packed_option=mac.pack("cccccc")
|
||||||
else #it must be an IP
|
else #it must be an IP
|
||||||
|
Loading…
Reference in New Issue
Block a user