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.


On Mon, Oct 21, 2013 at 9:06 AM, Simon Goldschmidt <[email protected]> wrote:

> Enrique Wellborn wrote:
> >  is there a worthy linux alternative to winpcap that works well with
> lwip and doesn't require adding a new device?
>
> There is libpcap for linux (in fact, libpcap existed before winpcap, if I
> remember correctly).
>
> I haven't found the time to do so, yet, but I think you should be able to
> take the pcap driver from the win32 port (pcapif.c/.h) and compile it
> against libpcap on linux. You will have to leave out the link state
> detection though (pcapif_helper.c/.h), as it relies on the win32 library
> "packet32" because link state information is (or was?) not provided by pcap.
>
> Simon
>
> _______________________________________________
> lwip-users mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/lwip-users
>
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to