Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logic error in handling error response #6

Open
Feng-Zihao opened this issue Jul 21, 2014 · 2 comments
Open

Logic error in handling error response #6

Feng-Zihao opened this issue Jul 21, 2014 · 2 comments

Comments

@Feng-Zihao
Copy link

in the logic of stun_test, there's code as below around line

    # around line 113:
    recvCorr = False
    while not recvCorr:
        # around line 136,
        bind_resp_msg = dictValToMsgType[msgtype] == "BindResponseMsg"
        tranid_match = tranid.upper() == binascii.b2a_hex(buf[4:20]).upper()
        if bind_resp_msg and tranid_match:

It does not handle the logic which the stun server return BindErrorResponseMsg, which lead to infinite loop.

This can be reproduce with a self setup stun server, and run the function with source ip = '0.0.0.0'.

But it's not a very big problem, I suggest to throw an error in this situation.
Because the server did response, but just it's an error response.

Thanks.

@jtriley
Copy link
Owner

jtriley commented Nov 5, 2014

@Feng-Zihao Thanks for reporting. Which stun server are you using to test locally - stuntman?

@Feng-Zihao
Copy link
Author

Oh... First reply from github issues !!
I'm using this one, on linux.
http://www.stunprotocol.org/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants