diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2013-07-03 21:29:13 +0200 |
---|---|---|
committer | Daniel Borkmann <dborkman@redhat.com> | 2013-07-03 21:29:13 +0200 |
commit | cfa76744cb9cea2649b0155b1bbdd0233a814307 (patch) | |
tree | f428feb73e577a9207a16bfb4fd818a95809eb24 /dev.c | |
parent | 489e84be7639caeb246b2dbaccd2a6e9fda9d2a5 (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>
Diffstat (limited to 'dev.c')
-rw-r--r-- | dev.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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); |