org-arl / unet-contrib

Unet user contributions
BSD 3-Clause "New" or "Revised" License
11 stars 15 forks source link

`unetsocket_receive` should check for protocol number before returning a msg #85

Open mchitre opened 1 year ago

mchitre commented 1 year ago

Currently the example doesn't check protocol number, and so for larger datagrams, user will see each fragment, which he should not.

notthetup commented 1 year ago

Shouldn't this happen inside unetsocket_receive? The user (in this case rxdata.c) should just get all the Datagrams with the protocol set to DATA or >=USER. And if the socket is bound to a specific protocol, then ONLY that protocol. But that filtering should be done inside the unetsocket_receive.

mchitre commented 1 year ago

Yes, correct