F #3263: fix bug with some IP addresses (#3493)

This commit is contained in:
Alejandro Huertas Herrero authored and Ruben S. Montero committed 2019-07-11 15:30:42 +02:00
1 parent bb1e696f2f
commit dd03200b2e
1 file changed
+6 -2
+6 -2
View File
@@ -198,8 +198,12 @@ module OneDBFsck
lease[:mac_index] = mac
# IP
unless ip.nil?
lease[:ip] = IPAddr.new(ip.to_i + index, Socket::AF_INET).to_s
begin
unless ip.nil?
lease[:ip] = IPAddr.new(ip.to_i + index, Socket::AF_INET).to_s
end
rescue StandardError
lease[:ip] = [ip.to_i + index].pack('N').unpack('CCCC').join('.')
end
# IP6