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

Doesn't seem to be able to both send and receive locally via local address #3411

Closed
zephyrbot opened this issue Mar 25, 2017 · 2 comments
Closed
Assignees
Labels
area: Networking bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Milestone

Comments

@zephyrbot
Copy link
Collaborator

zephyrbot commented Mar 25, 2017

Reported by Paul Sokolovsky:

I'm doing following:

  1. Create a UDP socket and bind it to a known local address (192.0.2.1), attach recv callback.
  2. Create another UDP socket, and send data to first socket's address (192.0.2.1:PORT).
  3. All this happens on the same device (specifically qemu_x86, specifically with Zephyr.js).

What I get is: socket #1 receives nothing, and socket #2 doesn't even have sent callback called. Whereas expected behavior is: socket #1 receive the data.

Is it supposed to work in Zephyr now? If not, that's not what POSIX (or common sense) wants. I'm looking into this because it's an easy way to perform automated integration testing for networking stuff (we can use it in sanitycheck tests).

(Imported from Jira ZEP-1966)

@zephyrbot
Copy link
Collaborator Author

by Jukka Rissanen:

Indeed this should work properly. We have check to localhost address (127.0.0.1) which should work ok and you should get the packet back, but we seem to be missing the check to our own address. This looks like a simple one liner to fix, I will investigate more.

@zephyrbot
Copy link
Collaborator Author

by Paul Sokolovsky:

Verified with my Zephyr.js, works perfect. Actually, I verified 2 cases: sending and receiving via a single context, and via 2 separate contexts. Thanks!

For reference, the JS code was:

{code:java}
var PORT = 33333;
var HOST = '192.0.2.1';

var dgram = require('dgram');

var server = dgram.createSocket('udp4');
server.on('message', function (message, remote) {
console.log(remote.address + ':' + remote.port +' - ' + message.toString("ascii"));
});
server.bind(PORT, HOST);

var client = dgram.createSocket('udp4');
var buf = new Buffer("foo");
client.send(buf, 0, buf.length, PORT, HOST);

console.log("End");
{code}

@zephyrbot zephyrbot added priority: medium Medium impact/importance bug area: Networking bug The issue is a bug, or the PR is fixing a bug labels Sep 23, 2017
@zephyrbot zephyrbot added this to the v1.8.0 milestone Sep 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Networking bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Projects
None yet
Development

No branches or pull requests

2 participants