We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f4ff8a4 commit 3670edeCopy full SHA for 3670ede
src/sniffit.c
@@ -1774,8 +1774,14 @@ int main (int argc, char *argv[])
1774
}
1775
else
1776
{
1777
- if((dev = pcap_lookupdev (ebuf)) == NULL)
+ pcap_if_t *alldevsp;
1778
+ if (pcap_findalldevs (&alldevsp, ebuf) == PCAP_ERROR)
1779
fprintf (stderr,"%s\n",ebuf), exit (1);
1780
+ if (alldevsp == NULL)
1781
+ fprintf (stderr, "No network devices available.\n"), exit (1);
1782
+ if ((dev = strdup (alldevsp[0].name)) == NULL)
1783
+ perror ("strdup"), exit (1);
1784
+ pcap_freealldevs (alldevsp);
1785
1786
1787
for (i = 0; i < NETDEV_NR; i++)
0 commit comments