summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Šimerda <pavlix@pavlix.net>2016-08-20 00:03:24 +0200
committerPavel Šimerda <pavlix@pavlix.net>2016-08-20 00:03:24 +0200
commite108fb2997556bc0f3ace6f514f2763e2235097c (patch)
tree20635081e759ce47ec2199308645acf3b2040893
parentb738a726b20496717df6365bef8f71f91c7c2347 (diff)
downloadiputils-e108fb2997556bc0f3ace6f514f2763e2235097c.tar.gz
ping: remove assignments of values that are never read
fixes #2
-rw-r--r--clockdiff.c6
-rw-r--r--ping.c4
-rw-r--r--ping6_common.c2
-rw-r--r--traceroute6.c1
4 files changed, 3 insertions, 10 deletions
diff --git a/clockdiff.c b/clockdiff.c
index 4473b93..ba55f2b 100644
--- a/clockdiff.c
+++ b/clockdiff.c
@@ -133,7 +133,7 @@ measure(struct sockaddr_in * addr)
long delta1, delta2;
struct timeval tv1, tout;
unsigned char packet[PACKET_IN], opacket[64];
- struct icmphdr *icp = (struct icmphdr *) packet;
+ struct icmphdr *icp;
struct icmphdr *oicp = (struct icmphdr *) opacket;
struct iphdr *ip = (struct iphdr *) packet;
@@ -175,7 +175,6 @@ empty:
((__u32*)(oicp+1))[1] = 0;
((__u32*)(oicp+1))[2] = 0;
FD_ZERO(&ready);
- msgcount = 0;
acked = seqno = seqno0 = 0;
@@ -310,7 +309,7 @@ measure_opt(struct sockaddr_in * addr)
long delta1, delta2;
struct timeval tv1, tout;
unsigned char packet[PACKET_IN], opacket[64];
- struct icmphdr *icp = (struct icmphdr *) packet;
+ struct icmphdr *icp;
struct icmphdr *oicp = (struct icmphdr *) opacket;
struct iphdr *ip = (struct iphdr *) packet;
@@ -352,7 +351,6 @@ empty:
((__u32*)(oicp+1))[2] = 0;
FD_ZERO(&ready);
- msgcount = 0;
acked = seqno = seqno0 = 0;
diff --git a/ping.c b/ping.c
index 4455091..b07f718 100644
--- a/ping.c
+++ b/ping.c
@@ -1357,8 +1357,6 @@ void pr_options(unsigned char * cp, int hlen)
case IPOPT_LSRR:
printf("\n%cSRR: ", *cp==IPOPT_SSRR ? 'S' : 'L');
j = *++cp;
- i = *++cp;
- i -= 4;
cp++;
if (j > IPOPT_MINOFF) {
for (;;) {
@@ -1391,8 +1389,6 @@ void pr_options(unsigned char * cp, int hlen)
&& !memcmp(cp, old_rr, i)
&& !(options & F_FLOOD)) {
printf("\t(same route)");
- i = ((i + 3) / 4) * 4;
- cp += i;
break;
}
old_rrlen = i;
diff --git a/ping6_common.c b/ping6_common.c
index d6965dc..1665b01 100644
--- a/ping6_common.c
+++ b/ping6_common.c
@@ -1294,7 +1294,7 @@ static
void pr_niquery_reply_addr(struct ni_hdr *nih, int len)
{
__u8 *h = (__u8 *)(nih + 1);
- __u8 *p = h + 4;
+ __u8 *p;
__u8 *end = (__u8 *)nih + len;
int af;
int aflen;
diff --git a/traceroute6.c b/traceroute6.c
index fdc916b..48fc5c5 100644
--- a/traceroute6.c
+++ b/traceroute6.c
@@ -609,7 +609,6 @@ int main(int argc, char *argv[])
while ((cc = wait_for_reply(icmp_sock, &from, &to, reset_timer)) != 0) {
gettimeofday(&t2, &tz);
if ((i = packet_ok(packet, cc, &from, &to, seq, &t1))) {
- reset_timer = 1;
if (memcmp(&from.sin6_addr, &lastaddr, sizeof(from.sin6_addr))) {
print(packet, cc, &from);
memcpy(&lastaddr,