]> The Tcpdump Group git mirrors - libpcap/commitdiff
Don't explicitly check for root permission.
authorGuy Harris <[email protected]>
Sun, 10 Feb 2019 20:08:04 +0000 (12:08 -0800)
committerGuy Harris <[email protected]>
Sun, 10 Feb 2019 20:08:04 +0000 (12:08 -0800)
Let DPDK tell us if we don't have sufficient permission to use it;
rte_eal_init() appears to return -1 and set rte_errno to EACCES in that
case, and we now handle that case ourselves.

pcap-dpdk.c

index 9b324e6b55d424343989ef282d4dff8afa75c5b4..df4bfd492bbe7b49c8caf6dfcea9b5fb2953ba1d 100644 (file)
@@ -581,16 +581,6 @@ static int dpdk_pre_init(char * ebuf)
                        return 1;
                }
        }
-       // check for root permission
-       // XXX - is it sufficient to call rte_eal_init() and check for
-       // EACCES?
-       if( geteuid() != 0)
-       {
-               RTE_LOG(ERR, USER1, "%s\n", DPDK_ERR_PERM_MSG);
-               pcap_snprintf(ebuf, PCAP_ERRBUF_SIZE,
-                   "DPDK requires that it run as root");
-               return PCAP_ERROR_PERM_DENIED;
-       }
        // init EAL
        ptr_dpdk_cfg = getenv(DPDK_CFG_ENV_NAME);
        // set default log level to debug