The method #include? in IPAddr looks like:

   def include?(other)
     if ipv4_mapped?
        ...
     end
     if other.kind_of?(IPAddr)
       if other.ipv4_mapped?
	other_addr = (other.to_i & IN4MASK)
	other_family = Socket::AF_INET
       else
	other_addr = other.to_i
	other_family = other.family
       end
       if family != other_family
	return false
       end
     end
     return ((addr & mask_addr) == (other_addr & mask_addr))
   end

This seems wrong - shouldn't the second half of the method be something 
like:

     if other.kind_of?(IPAddr)
       if other.ipv4_mapped?
	other_addr = (other.to_i & IN4MASK)
	other_family = Socket::AF_INET
       else
	other_addr = other.to_i
	other_family = other.family
       end
     else  # not an IP - assume integer IP address, same family as us
       other_addr = other.to_i
       other_family = family
     end
     if family != other_family
       return false
     end
     return ((addr & mask_addr) == (other_addr & mask_addr))

Otherwise if you pass in an integer IP address it can never match (as 
other_addr and other_family never get set). I'd submit a patch, but I'm 
not that sure of myself when it comes to IP.

Cheers


Dave