maxmbed commented on issue #11223:
URL: https://github.com/apache/nuttx/issues/11223#issuecomment-1826281959

   Thanks @anjiahao1, launching gdb with the admin privilege is working. I can 
access network now.
   
   Without sudo, the issue happens during the configuration of the tap device 
in `nuttx/arch/sim/src/sim/posix/sim_tapdev.c`
   A error message is logged to host syslog but it is not prompted in the Nuttx 
shell.    
   
   ```c
    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 theLinux capabilities but that does not seems to work 
when I try  `sudo setcap cap_net_admin+ep /usr/bin/gdb` or `setcap 
cap_net_raw,cap_net_admin=eip /usr/bin/gdb`. 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to