Raizo62 / vwifi

Simulator of WiFi (802.11) interfaces to communicate between several Virtual Machines
GNU Lesser General Public License v3.0
58 stars 8 forks source link

OpenWRT X86_64 porting #2

Closed nickbash11 closed 3 years ago

nickbash11 commented 4 years ago

I get an unsolvable situation during attempt to compile vwifi on OpenWRT SDK. So yes, I've create a Makefile, and you can see it in my git repository But it has missing libraries, which do not present in openwrt packages:

Package vwifi is missing dependencies for the following libraries: libc.so.6 libm.so.6 libpthread.so.0

vwifi.log But those are presented in SDK directory openwrt-sdk-19.07.4-x86-64_gcc-7.5.0_musl.Linux-x86_64/staging_dir/host/lib/

Could you help me to solve this issue?

Raizo62 commented 3 years ago

No, it is not enough. Sorry

Raizo62 commented 3 years ago

Can you test this branch : bug_big_ping ?

nickbash11 commented 3 years ago

Can you test this branch : bug_big_ping ?

I will test it as soon as I can. Do I have to use that branch for OpenWRT and Debian hosts?

Raizo62 commented 3 years ago

Do I have to use that branch for OpenWRT and Debian hosts?

Yes. I hope the code is compatible. The differences are not in the functions.

nickbash11 commented 3 years ago

I've tested. It keeps stable up to 1200 bytes, over that it starts to reconnect and even falls to segmentation fault. Screenshot_2020-09-22_12-42-13

Raizo62 commented 3 years ago

After debug, to "solve", i have increase an array from 1024 to 2048. I have tested with ping -c 5 -s 3000 10.0.0.1 between 2 Debians without error.

I am surprize that you crash with 1200 bytes. I can use a dynamic array, but perhaps there is an other bug

Raizo62 commented 3 years ago

Are you sure to use the last version on each VM / Server ?

nickbash11 commented 3 years ago

Are you sure to use the last version on each VM / Server ?

I used Openwrt as an AP and Debian as a client.

nickbash11 commented 3 years ago

I precisely checked out to the branch bug_big_ping and then copied it to OpenWRT and Debian VM

nickbash11 commented 3 years ago

Can you add some function to control the commit version of the binary files? something like:

# vwifi-guest --version
commit 2a8216e98162d1abf04bf315cbc51754c3ccc9d8

It can help to debug in the future to understand what exactly version we use on the host.

nickbash11 commented 3 years ago

I've convinced that two debian VM get the same result in AP and MESH modes.

Raizo62 commented 3 years ago

I try a dynamic buffer.

In the meantime, you can try :

Could you give me your commands to config the OpenWRT ?

nickbash11 commented 3 years ago
* For the segmentation fault : In ckernelwifi.cc , move "char Buffer[2048];"  (line 34) in the top of "void CKernelWifi::recv_from_server()"

There are buffers already on top

* No frame data : In ckernelwifi.cc and vwifi-server.cc, increase the size of "Buffer"

Increased buffers up to 4096 have no effect, it has stuck on 1270 bytes max.

Could you give me your commands to config the OpenWRT ?

I configure it via editing config files /etc/config/network and /etc/config/wireless ,not via uci or luci You can see it in that VM http://www.filedropper.com/openwrt-19073 which I've already represented

Raizo62 commented 3 years ago

There are buffers already on top

in ckernelwifi.cc , move "char Buffer[2048];" (line 34) to line 513 (top of "void CKernelWifi::recv_from_server()")

nickbash11 commented 3 years ago

in ckernelwifi.cc , move "char Buffer[2048];" (line 34) to line 513 (top of "void CKernelWifi::recv_from_server()")

Segfaults disappeared. What I could reach is about 1400 bytes with 50% loss.

Raizo62 commented 3 years ago

Could you test again the branch bug_big_ping ?

nickbash11 commented 3 years ago

The compilation ends with error

vwifi_compile_erorr.txt

Raizo62 commented 3 years ago

You forgot to update the path of libnl in the Makefile

Is it a new warning ? have you updated your builder g++ ? what is his version ?

nickbash11 commented 3 years ago

You forgot to update the path of libnl in the Makefile

NETLINK_FLAGS = -I/usr/include/libnl3
NETLINK_LIBS = -lnl-genl-3 -lnl-3

I've just checked out to bug_big_ping as always

Is it a new warning ? have you updated your builder g++ ? what is his version ?

root@builds:~# g++ --version
g++ (Debian 8.3.0-6) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

root@builds:~# cat /etc/debian_version 
10.5

Pure Debian and Kali Linux both systems have the same error.

nickbash11 commented 3 years ago
# git branch -a
* bug_big_ping
  master
  remotes/origin/HEAD -> origin/master
  remotes/origin/beta
  remotes/origin/bug_big_ping
  remotes/origin/bug_dhcp
  remotes/origin/dhcp
  remotes/origin/for_liveraizo_v11.20.02.23p
  remotes/origin/for_liveraizo_v11.20.04.27p
  remotes/origin/for_liveraizo_v11.20.06.28p
  remotes/origin/for_liveraizo_v11.20.09.14p
  remotes/origin/master
  remotes/origin/openwrt
  remotes/origin/readme
Raizo62 commented 3 years ago

You forgot to update the path of libnl in the Makefile

NETLINK_FLAGS = -I/usr/include/libnl3
NETLINK_LIBS = -lnl-genl-3 -lnl-3

g++ doesn't found library files (.a or .so) of libnl

On Openwrt, edit the file "Makefile" to modify the values of : NETLINK_LIBS = -L/root/libnl/libs -lnl-genl-3 -lnl-3

Is it a new warning ? have you updated your builder g++ ? what is his version ?

root@builds:~# g++ --version
g++ (Debian 8.3.0-6) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

root@builds:~# cat /etc/debian_version 
10.5

Pure Debian and Kali Linux both systems have the same error.

Thank you. I can reproduce to remove the warnings. But it is warnings. It does not matter

nickbash11 commented 3 years ago

g++ doesn't found library files (.a or .so) of libnl

On Openwrt, edit the file "Makefile" to modify the values of : NETLINK_LIBS = -L/root/libnl/libs -lnl-genl-3 -lnl-3

I catch the same error on Debian and OpenWrt, I always change makefile according to the wiki for openwrt.

Ok, I've just built master branch without any problems with the same environment on the debian, but the branch bug_big_ping can't

nickbash11 commented 3 years ago

I added $(NETLINK_LIBS) to 93 string of Makefile and it built

Raizo62 commented 3 years ago

Yes. You are right. I had remove accidentally this variable from Makefile. I have updated the branch

nickbash11 commented 3 years ago

it seems to work

nickbash11 commented 3 years ago

opkg update was success through vwifi and 802.11s ! That was what I needed

Raizo62 commented 3 years ago

Thank you for your help :-)