summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Habets <thomas@habets.pp.se>2010-04-01 18:48:36 +0200
committerThomas Habets <thomas@habets.pp.se>2010-04-01 18:48:36 +0200
commitdf36995363d6b92d635d353a55ba4b51ce004b5a (patch)
tree174f120c4d0a0942b37328e09e25c02dffc99412
parentd4810ddc781235a51d2ef08315d69bca236ef1cf (diff)
parentbbcfde4425c9d9b0f3fbfc9c4e7fa0a5a0225c97 (diff)
downloadarping-df36995363d6b92d635d353a55ba4b51ce004b5a.tar.gz
Merge fixarping-2.09
-rw-r--r--README20
-rw-r--r--doc/arping.yodl4
-rw-r--r--src/arping.c5
3 files changed, 15 insertions, 14 deletions
diff --git a/README b/README
index ad655c6..7b90a34 100644
--- a/README
+++ b/README
@@ -227,36 +227,36 @@ For pinging IP addresses:
When a host wants to send an IP packet to another host, it sends out an ARP
packet asking what MAC the destination IP address has, a so-called 'who-has'
packet. This is then answered by another ARP packet, the 'is-at' packet.
-
+
18:16:07.179699 0:10:5a:3e:c5:b4 ff:ff:ff:ff:ff:ff 0806 42:
arp who-has 192.168.0.1 tell 192.168.0.2
-
+
This is the packet generated by arping.
An Ethernet frame from my 3com card to the broadcast address carrying an arp
packet asking what MAC 192.168.0.1 has (who-has).
-
+
18:16:07.180221 0:60:93:34:91:99 0:10:5a:3e:c5:b4 0806 60:
arp reply 192.168.0.1 is-at 0:60:93:34:91:99
-
+
The answer, that 192.168.0.1 has MAC 0:60:93:34:91:99 (is-at).
-
+
For pinging MAC addresses:
A broadcast ping (255.255.255.255, or any address supplied with -T, see below)
is sent out on the Ethernet, but in an Ethernet frame addressed to the target
MAC only.
-
+
18:20:09.627321 0:10:5a:3e:c5:b4 0:60:93:34:91:99 0800 42:
192.168.0.2 > 255.255.255.255: icmp: echo request
(ttl 48, id 17767, len 28)
-
+
This is the packet generated by arping.
Ethernet frame from my 3com NIC to the destination MAC, carrying a broadcast
ping.
-
+
18:20:09.628432 0:60:93:34:91:99 0:10:5a:3e:c5:b4 0800 60:
192.168.0.1 > 192.168.0.2: icmp: echo reply
(ttl 255, id 7593, len 28)
-
+
The answer, including the source address of the target host. Note that this
is not how every OS responds to a broadcast ping (if at all). Some answer with
a source address equal to the broadcast address, and others don't' answer at
@@ -278,7 +278,7 @@ For pinging MAC addresses:
go through more in less time, or check out arping-scan-net.sh, which is a
more capable script for scanning, but you need to edit it since the address
range it searches is hard-coded.
- I may add this to arping some day, but don't hold your breath.
+ I may add this to arping some day, but don't hold your breath.
----------------------------------------------------------------------------
Send questions/suggestions/patches/rants/money/alphas to thomas@habets.pp.se
diff --git a/doc/arping.yodl b/doc/arping.yodl
index 2484ca1..1f655bc 100644
--- a/doc/arping.yodl
+++ b/doc/arping.yodl
@@ -95,7 +95,7 @@ mancommand(.sp)
60 bytes from 00:11:85:4c:01:01 (88.123.180.225): index=0 time=13.910 msec
60 bytes from 00:11:85:4c:01:01 (88.123.180.225): index=1 time=13.935 msec
60 bytes from 00:11:85:4c:01:01 (88.123.180.225): index=2 time=13.944 msec
-
+
--- 88.123.180.225 statistics ---
3 packets transmitted, 3 packets received, 0% unanswered
@@ -104,7 +104,7 @@ mancommand(.sp)
60 bytes from 88.123.180.225 (00:11:85:4c:01:01): icmp_seq=0 time=13.367 msec
60 bytes from 88.123.180.225 (00:11:85:4c:01:01): icmp_seq=1 time=13.929 msec
60 bytes from 88.123.180.225 (00:11:85:4c:01:01): icmp_seq=2 time=13.929 msec
-
+
--- 00:11:85:4c:01:01 statistics ---
3 packets transmitted, 3 packets received, 0% unanswered
diff --git a/src/arping.c b/src/arping.c
index 2fff271..7b5e43e 100644
--- a/src/arping.c
+++ b/src/arping.c
@@ -111,7 +111,7 @@ static libnet_t *libnet = 0;
static struct timeval lastpacketsent;
-uint32_t srcip,dstip;
+uint32_t srcip, dstip;
static int beep = 0;
static int reverse_beep = 0;
@@ -125,7 +125,7 @@ static unsigned int numrecvd = 0;
static unsigned int numdots = 0;
static int addr_must_be_same = 0;
/* RAWRAW is RAW|RRAW */
-static enum { NORMAL,QUIET,RAW,RRAW,RAWRAW,DOT } display = NORMAL;
+static enum { NORMAL, QUIET, RAW, RRAW, RAWRAW, DOT } display = NORMAL;
static char *target = "huh? bug in arping?";
static uint8_t ethnull[ETH_ALEN];
static uint8_t ethxmas[ETH_ALEN];
@@ -133,6 +133,7 @@ static char srcmac[ETH_ALEN];
static char dstmac[ETH_ALEN];
static char lastreplymac[ETH_ALEN];
+/* doesn't need to be volatile */
volatile int time_to_die = 0;
/**