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

PicoTCP unable to use loopback devices. #10

Open
WorksButNotTested opened this issue Apr 14, 2022 · 1 comment
Open

PicoTCP unable to use loopback devices. #10

WorksButNotTested opened this issue Apr 14, 2022 · 1 comment

Comments

@WorksButNotTested
Copy link

I have written a custom device to my application to allow PicoTCP to send and receive data over raw sockets on Linux. (e.g. using socket (AF_PACKET, SOCK_RAW, htons (ETH_P_ALL)), with sendto and recvfrom) which is working well when sending traffic between hosts. (e.g. one app with PicoTCP embedded acting as a TCP server on one host and another app acting as the TCP client on another host).

However, it would be helpful to also run this for testing purposes with both client and server running on the same host (either on a loop-back adapter or even on a physical adapter) . Unfortunately, when the client is listening for its responses on the same IP address as the server it is intending to send it's packets to, rather than the out-bound packets being sent down to the device layer to be written to the link, the client application attempts to process the out-bound packet itself resulting in an error message saying "No such port".

It would seem that the design (understandably) is such that the stack assumes it has exclusive ownership of any IP it is managing, but is there any means to modify this behavior?

@WorksButNotTested
Copy link
Author

WorksButNotTested commented Apr 14, 2022

It looks like it determines where to send the packet around here?

if (pico_ipv4_link_get(S, &hdr->dst)) {

and
if(!memcmp(hdr->daddr, hdr->saddr, PICO_SIZE_ETH)) {

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

1 participant