avonar / impacket

Automatically exported from code.google.com/p/impacket
Other
0 stars 0 forks source link

Code fix to handle IGMP packet #30

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Steps need to properly handle IGMP packet:

==ImpactDecoder.py==
add at line 91:
        elif i.get_ip_p() == ImpactPacket.IGMP.protocol:
            self.igmp_decoder = IGMPDecoder()
            packet = self.igmp_decoder.decode(aBuffer[off:])

add at line 171:
class IGMPDecoder(Decoder):
    def __init__(self):
        pass

    def decode(self, aBuffer):
        ig = ImpactPacket.IGMP(aBuffer)
        off = ig.get_header_size()
        self.data_decoder = DataDecoder()
        packet = self.data_decoder.decode(aBuffer[off:])
        ig.contains(packet)
        return ig

==ImpactPacket.py==
change line 1670:
answer = tmp_dict.get(aType, 'UNKNOWN TYPE OR VERSION ')

change line 1680:
tmp_str += 'Group: ' + socket.inet_ntoa(struct.pack('!L',self.get_igmp_group()))

Hope I haven't missed anything!

Original issue reported on code.google.com by andrewrw...@gmail.com on 1 Jul 2013 at 3:26

GoogleCodeExporter commented 9 years ago
Hey andrew.. thanks for the fix!

Could you please, instead of specifing lines, send me a diff with the latest 
files in trunk so I can apply the patches and do some tests?.. That's way 
cleaner than changing the lines by numbers here.. 

thanks again!

beto

PS: or.. if it is a problem for you .. just send me the entire files

Original comment by bet...@gmail.com on 2 Jul 2013 at 8:53

GoogleCodeExporter commented 9 years ago
Hey, not a problem. I've never had to work with diffs before, but will if I
come across anything in the future.

Andrew

Original comment by andrewrw...@gmail.com on 3 Jul 2013 at 12:05

GoogleCodeExporter commented 9 years ago

Original comment by bet...@gmail.com on 11 Oct 2013 at 3:37