summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2013-07-03 21:29:13 +0200
committerDaniel Borkmann <dborkman@redhat.com>2013-07-03 21:29:13 +0200
commitcfa76744cb9cea2649b0155b1bbdd0233a814307 (patch)
treef428feb73e577a9207a16bfb4fd818a95809eb24
parent489e84be7639caeb246b2dbaccd2a6e9fda9d2a5 (diff)
dev: linktype: use ARPHRD_ETHER for "any" device
Use ARPHRD_ETHER for the "any" device, so that when typing "netsniff-ng" without any arguments, ethernet is assumed. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
-rw-r--r--dev.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/dev.c b/dev.c
index f109a61..3fafbde 100644
--- a/dev.c
+++ b/dev.c
@@ -2,6 +2,8 @@
#include <errno.h>
#include <sys/ioctl.h>
#include <sys/types.h>
+#include <sys/socket.h>
+#include <linux/if_arp.h>
#include <ifaddrs.h>
#include "dev.h"
@@ -40,7 +42,7 @@ int device_type(const char *ifname)
struct ifreq ifr;
if (!strncmp("any", ifname, strlen("any")))
- return 0;
+ return ARPHRD_ETHER;
sock = af_socket(AF_INET);