The pcap_lookupdev() fills in the errbuf variable when run as non-root user, while the same functions returns the value of the first available network interface
pcap_lookupdev()
Many of the pcap functions require root privileges in order to work correctly. Might this be the problem?