In my test setup, both BBN1/2 and MP1/2 are in one subnet.
ipv4_arp_request ret = -1 interface =0x120020070 sipaddr = 0x50505f7 (the first try, sipaddr is right) ipv4_arp_request ret = 0 interface =0x120020070 sipaddr = 0x50505f7 (the second try with latest patch)
the cause should be there is no arp entry for the source ip address at the first try.
-----Original Message----- From: Jonathan Haws jhaws@sdl.usu.edu Sent: 2018年10月30日 0:07 To: guohuizou2000@sina.com; sven@narfation.org Cc: b.a.t.m.a.n@lists.open-mesh.org Subject: Re: [B.A.T.M.A.N.] alfred and batadv-vis issue
The patch does NOT work for me.
I review the code again and find the issue. The following code may make my testbed work.
Gary - can you describe to me some more details of your test setup? How are BBN1 and BBN2 configured? Are they machines with two different Ethernet interfaces (i.e. each having one connected to the downstream node and one connected to the switch)? Are they more or less acting as routers (i.e. doing IP forwarding)?
The testing I have been doing is just connecting MP1 and MP2 to the same switch and having them on the same subnet. Is that not the case in your setup?
The other thing I am interested in is what is the result of the first ioctl() call? I'm guessing it has to be failing, or else the patch would have worked for you. Can you add a print statement before the return that would give the error string as well as the interface and IP (i.e. interface->interface and addr->ipv4.s_addr)? That would be helpful in helping me find the root issue.
One thing to note (and Sven, maybe you can tell me if this is expected): in my testing I found that alfred is getting into this ipv4_arp_request call for the local node as well, thus the very first ioctl() will fail with "No such device or address". Should there be a check for this being the local node and just discard it before making the check or is making the check all the time then discarding okay?