Skip to content

Commit

Permalink
Use Integer#allbits? and Integer#nobits? for rubocop.
Browse files Browse the repository at this point in the history
  • Loading branch information
postmodern committed Nov 19, 2024
1 parent 61ac5ce commit 02c341c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ronin/support/network/ip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def self.extract(text,version=nil,&block)
#
def broadcast?
# NOTE: IPv6 does not have broadcast addresses
ipv4? && (@addr & 0xff) == 0xff
ipv4? && @addr.allbits?(0xff) # IPv4: A.B.C.255
end

#
Expand All @@ -309,7 +309,7 @@ def broadcast?
# # => false
#
def logical?
ipv4? && (@addr & 0xff) == 0x00
ipv4? && @addr.nobits?(0xff) # IPv4: A.B.C.0
end

#
Expand Down

0 comments on commit 02c341c

Please sign in to comment.