Open maxmbed opened 10 months ago
@maxmbed can you ping NuttX from your host? You need ICMP enabled on NuttX!
@alandeassis, No, the host cannot ping Nuttx in this case.
Actually, the sim:tcpblaster
example has already ICMP support enabled.
Network is accessible if I run tcpblaster example and follow this guide but when it is launched with GDB, network access does not work.
gdb ./build/nuttx tools/gdb/__init__.py
@masayuki2009 any idea why network in the SIM is not accessing when using GDB ?
@alandeassis, No, the host cannot ping Nuttx in this case.
Actually, the
sim:tcpblaster
example has already ICMP support enabled. Network is accessible if I run tcpblaster example and follow this guide but when it is launched with GDB, network access does not work.
gdb ./build/nuttx tools/gdb/__init__.py
you mean just run nuttx
network is ok? but nuttx
run with gdb, network get error ?
@maxmbed It may be caused by gdb not having network permissions? Try using sudo gdb
Thanks @anjiahao1, launching gdb with the admin privilege is working. I can access network now.
Without sudo, the issue occurs during the configuration of the tap device in nuttx/arch/sim/src/sim/posix/sim_tapdev.c
A message of error is logged in the host syslog but does not prompt any in the Nuttx shell.
207 /* Configure the tap device */
208
209 memset(&ifr, 0, sizeof(ifr));
210 ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
211 ret = ioctl(tapdevfd, TUNSETIFF, (unsigned long) &ifr);
212 if (ret < 0)
213 {
214 syslog(LOG_ERR, "TAPDEV: ioctl failed: %d\n", -ret);
215 close(tapdevfd);
216 return;
217 }
Though, I don't like the idea to give admin privilege to GDB because there is good reason to use the Linux capabilities instead. But that does not seems to work when I tried sudo setcap cap_net_admin+ep /usr/bin/gdb
or setcap cap_net_raw,cap_net_admin=eip /usr/bin/gdb
.
Cannot find a way to apply Linux capability to gdb. If anyone see a solution, please let me us know here.
When running Nuttx
sim:tcpblaster
in GDB , I am encountering a problem to access the network. I cannot seem to access or to ping either the gateway or dns 8.8.8.8.I tried to set kernel capabilities of gdb to access the tap device but no success
Nuttx version: master branch b5d640acc
Here is some logs wit hNetwork Debug Features enabled.
Ping failure:
Ping success:
IP config of Nuttx sim:
Host tap ip config: