pystun icon indicating copy to clipboard operation
pystun copied to clipboard

KeyError: '0100'

Open ulope opened this issue 8 years ago • 0 comments

Sometimes calling get_nat_type() fails with KeyError: '0100'.

Truncated traceback:

  File "/Users/ulo/Envs/test/lib/python2.7/site-packages/stun/__init__.py", line 219, in get_nat_type
    changeRequest)
  File "/Users/ulo/Envs/test/lib/python2.7/site-packages/stun/__init__.py", line 136, in stun_test
    bind_resp_msg = dictValToMsgType[msgtype] == "BindResponseMsg"
KeyError: '0100'

According to https://tools.ietf.org/html/rfc5389#appendix-A and https://tools.ietf.org/html/rfc5389#section-18.1 0100 seems to be a success message for reserved method id 0x000 (which admittedly doesn't make much sense).

I'm not sure what the correct behaviour would be here, however a KeyError seems to be the wrong one ;)

ulope avatar Aug 30 '17 15:08 ulope