clarartp / dpkt

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

in Diameter it dont calculate the filling bits in the first AVP to generate the second #70

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
diam = dpkt.diameter.Diameter(eth.ip.tcp.data)
diam.avps
[AVP(code=263, flags=64, len=38, data='ggsnv9vlz1;3511161808;190;6943'),
 AVP(flags=1, len=147456, data='\x00\x0c\x00\x00\x00\x04\x00\x00\x01\x08@\x00\x00\x12ggsnv9vlz1\x00\x00\x00\x00\x01(@\x00\x00"ggsnv9vlz3@movistar.com.ar\x00\x00\x00\x00\x01\x1b@\x00\x00#vlzfedsdp2c@movistar.com.ar\x00\x00\x00\x01\xcd@\x00\x00\x0fcontext\x00\x00\x00\x01\xa0@\x00\x00\x0c\x00\x00\x00\x02\x00\x00\x01\x9f@\x00\x00\x0c\x00\x00\x07)\x00\x00\x01%@\x00\x00\x13vlzfedsdp2c\x00\x00\x00\x01\x16@\x00\x00\x0c\xd1<\xf76\x00\x00\x007@\x00\x00\x0c\xd1P+\xc4\x00\x00\x01\xbb@\x00\x0...........
the First AVP is fine, but the second is not. Because it doesn't skip the 
filling bits from the first AVP to generate it.

What is the expected output? What do you see instead?
this sould be the second AVP
AVP(code=258, flags=64, len=12, data='\x00\x00\x00\x04')

What version of the product are you using? On what operating system?
1.6

Sorry for my english

Original issue reported on code.google.com by nicolas....@aenima-x.com.ar on 15 Apr 2011 at 8:51

GoogleCodeExporter commented 9 years ago
Here is the problem:
while self.data:
            avp = AVP(self.data)
            l.append(avp)
            self.data = self.data[len(avp):]
        self.data = self.avps = l

when data is splited, it should be done counting the filling bits

Original comment by nicolas....@aenima-x.com.ar on 18 Apr 2011 at 2:25