Skip to content
Snippets Groups Projects
Commit 7962a57f authored by Pierre Lalet's avatar Pierre Lalet Committed by GitHub
Browse files

Merge pull request #214 from secdev/IPv4_mutlicast

IPv4 mDNS support
parents 7c53ff42 86ad1391
No related branches found
No related tags found
No related merge requests found
...@@ -396,6 +396,8 @@ class IP(Packet, IPTools): ...@@ -396,6 +396,8 @@ class IP(Packet, IPTools):
and (self.payload.type in [3,4,5,11,12]) ): and (self.payload.type in [3,4,5,11,12]) ):
return self.payload.payload.hashret() return self.payload.payload.hashret()
else: else:
if self.dst == "224.0.0.251": # mDNS
return struct.pack("B", self.proto) + self.payload.hashret()
if conf.checkIPsrc and conf.checkIPaddr: if conf.checkIPsrc and conf.checkIPaddr:
return strxor(inet_aton(self.src),inet_aton(self.dst))+struct.pack("B",self.proto)+self.payload.hashret() return strxor(inet_aton(self.src),inet_aton(self.dst))+struct.pack("B",self.proto)+self.payload.hashret()
else: else:
...@@ -403,8 +405,11 @@ class IP(Packet, IPTools): ...@@ -403,8 +405,11 @@ class IP(Packet, IPTools):
def answers(self, other): def answers(self, other):
if not isinstance(other,IP): if not isinstance(other,IP):
return 0 return 0
if conf.checkIPaddr and (self.dst != other.src): if conf.checkIPaddr:
return 0 if other.dst == "224.0.0.251" and self.dst == "224.0.0.251": # mDNS
return self.payload.answers(other.payload)
elif (self.dst != other.src):
return 0
if ( (self.proto == socket.IPPROTO_ICMP) and if ( (self.proto == socket.IPPROTO_ICMP) and
(isinstance(self.payload, ICMP)) and (isinstance(self.payload, ICMP)) and
(self.payload.type in [3,4,5,11,12]) ): (self.payload.type in [3,4,5,11,12]) ):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment