Yup. Worked as expected.

Cheers,
Curtis


On Mar 12, 2014, at 12:17 AM, Murphy McCauley <murphy.mccau...@gmail.com> wrote:

> If you wanted to check the attached slightly tweaked version of dns.py, I'd 
> push it to dart.
> 
> -- Murphy
> <dns.py>
> On Mar 11, 2014, at 9:11 PM, Curtis Taylor <yamahabo...@gmail.com> wrote:
> 
>> Murphy,
>> 
>> Exactly as you suggested. 3 changes did the trick.
>> 
>> * Added at Line 244 packet.dns:
>>   elif r.qtype == 28:
>>     assert isinstance(r.rddata, IPAddr6)
>>     return s + r.rddata.toRaw()
>> 
>> * Changed Line 435 packet.dns:
>> return IPAddr6.from_raw(l[beg_index : beg_index + dlen])
>> 
>> * Added at line 521 (semi-arbitrary) addresses.py:
>> def toRaw (self):
>>   return self.raw
>> 
>> Thanks for the help!
>> 
>> —Curtis
>> On Mar 11, 2014, at 11:13 PM, Murphy McCauley <murphy.mccau...@gmail.com> 
>> wrote:
>> 
>>> On Mar 11, 2014, at 7:35 PM, Curtis Taylor <yamahabo...@gmail.com> wrote:
>>> 
>>>> Hi,
>>>> 
>>>> I’m trying to parse and alter AAAA (IPv6) DNS responses with POX, but I 
>>>> get the following error:
>>>> ��B�)'packet:(dns) parsing answers: Bad address format
>>>> 
>>>> The error stems from around line 398 in addresses.py. At that point in the 
>>>> execution, my IPv6 address (converted to hex from binary) is 
>>>> 20010db8000000000000ff0000428329, which is correct. However, it appears 
>>>> that POX is attempting to split, based on colons, but these shouldn’t be 
>>>> in the binary representation of the IP -- (isinstance(addr, bytes) and not 
>>>> raw) is True.
>>> 
>>> I don't know what "binary representation" means in this context.  Is this a 
>>> string containing 32 hex characters?  Or is it 16 raw bytes?
>>> 
>>> The latter one (16 raw bytes) should be supported by IPAddr6 if it's passed 
>>> into the constructor with raw=True (or using the from_raw() factory).  The 
>>> former isn't supported -- it needs to be a properly formatted IPv6 address 
>>> (e.g., as per rfc5952), which contains colons.
>>> 
>>> It seems like packet.dns maybe has a bug here where line 432 should use the 
>>> from_raw() factory but doesn't.  If you make that fix does that help?
>>> 
>>>> I’ve attempted to alter addresses.py change addr from bytes to a IPv6 
>>>> string separated by colons (2001:0db8:0000:0000:0000:ff00:0042:8329), but 
>>>> I only break things later down the line (dns.py for me). I also see 
>>>> nothing irregular with the OpenFlow traffic to the controller.
>>> 
>>> Can you elaborate on what breaks and how it breaks?  Does it break in the 
>>> dns class's hdr() method?  If so, a quick guess is that putData() needs an 
>>> if clause for qtype == 28 which is much like the one for qtype == 1.
>>> 
>>>> My current setup:
>>>> POX - 0.2.0 (carp) - l3_learning (also shows parsing error as above)
>>>> Mininet with custom topology
>>>> BIND9 - the entry in question looks like "server1  IN      AAAA    
>>>> 2001:db8::ff00:42:8329”. Wireshark shows nothing wrong with the DNS 
>>>> request/response.
>>>> 
>>>> Any help would be appreciated. 
>>>> 
>>>> Cheers,
>>>> Curtis
>>> 
>> 
> 

Reply via email to