53b989f283
don't coerce nil to 0
22 lines
259 B
Ruby
22 lines
259 B
Ruby
# -*- coding: binary -*-
|
|
|
|
module Msf
|
|
|
|
###
|
|
#
|
|
# Network port option.
|
|
#
|
|
###
|
|
class OptPort < OptInt
|
|
def type
|
|
return 'port'
|
|
end
|
|
|
|
def valid?(value, check_empty: true)
|
|
port = normalize(value).to_i
|
|
super && port <= 65535 && port >= 0
|
|
end
|
|
end
|
|
|
|
end
|