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

Fix parse error for z_sender_sockaddr #4

Merged
merged 2 commits into from
Apr 16, 2018

Conversation

krawthekrow
Copy link
Contributor

Allows z_sender_sockaddr to be ZASCII, following the C version (https://github.com/zephyr-im/zephyr/blob/master/lib/ZParseNot.c#L251). I'm not sure if there's updated documentation for this, but Zephyr returns it in ZASCII when I do a subscribe.

@davidben
Copy link
Contributor

Thanks!

Do you mind adding a quick test to cover this path? It's been a while since I've seen any of this code, but it looks like TestDecodeNotice in notice_test.go has a zcode test. You could just add the corresponding zascii one.

Bonus stuff If you feel motivated to, but no need to bother if not: In hindsight, 8.8.8.8 was a really dumb choice of test input on my part, since it doesn't catch endianness. Probably, like, any other IP address would have been better. :-) Though I guess sampleNotice/sampleRawNotice have another IP in there. I probably also should have tested IPv6.

@krawthekrow
Copy link
Contributor Author

Sure! I've added the test.

@davidben davidben merged commit 932a267 into zephyr-im:master Apr 16, 2018
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

Successfully merging this pull request may close these issues.

2 participants