summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Habets <thomas@habets.pp.se>2009-11-06 15:40:01 +0100
committerThomas Habets <thomas@habets.pp.se>2009-11-06 15:40:01 +0100
commit1c15a3c8c4b8581d401d13796099aaddaa82cd55 (patch)
tree4c212dba594049e14d554d392b1509f3492dd472
parentc2aca9b91c0738429daa9b8ebafbbcb79e59fc3c (diff)
downloadarping-1c15a3c8c4b8581d401d13796099aaddaa82cd55.tar.gz
default to own IP address when doing -d
-rw-r--r--src/arping.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/arping.c b/src/arping.c
index 0a6adba..0e3dcfb 100644
--- a/src/arping.c
+++ b/src/arping.c
@@ -1121,6 +1121,17 @@ int main(int argc, char **argv)
parm = (optind < argc) ? argv[optind] : NULL;
+ /* default to own IP address when doing -d */
+ if (finddup && !parm) {
+ dstip_given = 1;
+ do_libnet_init(ifname);
+ dstip = libnet_get_ipaddr4(libnet);
+ if (verbose) {
+ printf("defaulting to checking dup for %s\n",
+ libnet_addr2name4(dstip, 0));
+ }
+ }
+
/*
* Handle dstip_given instead of ip address after parms (-B really)
*/