Hey Simon,
Your suggestion worked, well, almost perfectly.
I managed to compile the win32 pcapif.c against libpcap on linux and it works well except for one little issue -
lwip can now communicate with all the nodes in my network, except for the node on which it's running.
The scenario is as follows:
My Ubuntu machine is at
192.168.0.3/24 (hereinafter called ubuntu) and is running lwip's simhost with the ip:
192.168.0.4/24(hereinafter called lwip).
I can communicate with lwip at 192.168.0.4 from all the nodes in the network, except for 192.168.0.3.
After some sniffing around, I saw that there was a problem with arp between the nodes.
For some reason, my ubuntu machine refused to acknowledge arp replies from the lwip node, so when I try to connect to lwip from ubuntu I see ubuntu's arp request for lwip's address, lwip's reply, and than just a bunch of another requests and replies. Ubuntu's arp table shows a weird entry for lwip's address:
#arp -an
? (192.168.0.3) at <incomplete> on eth0
After realizing the problem was with arp, I set a static arp entry for lwip on ubuntu which led to a different problem - now that the nodes acknowledged each other's mac address, they couldn't complete a 3 way handshake because ubuntu still didn't acknowledge lwip's SIN-ACK's and kept sending more SYN's.
It seems like it is the same problem in both cases. For some reason, ubuntu simply doesn't accept packets from lwip.
Every help would be extremely appreciated, I'm feeling kind of lost.
Thank you very much,
Enrique.
p.s.
This might be a lead - I noticed that all arp replies from lwip to ubuntu were not padded. they were only 42 bytes long, while every other node was sent a 60 bytes reply, with the last 18 bytes zero-padded.