summaryrefslogtreecommitdiff
path: root/usr.sbin/dhcpd/icmp.c
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-04-22 15:22:49 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-04-22 15:22:49 +0000
commit07ad12b9bcc09a28c09cb49248a600d6c9b2d8ed (patch)
tree2a4e84e86fd052bdbefff4c08172fea2721c6484 /usr.sbin/dhcpd/icmp.c
parentca99c31b79f8022ed3138bcb4fff8f63e30e8cfe (diff)
instead of using some lower 16 bits of some address on the stack that
even requires knowledge about wether the machine is 32 or 64 bit, use getpid() for the icmp id. that is not optimal, but matches what ping does and the way to go for now.
Diffstat (limited to 'usr.sbin/dhcpd/icmp.c')
-rw-r--r--usr.sbin/dhcpd/icmp.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/usr.sbin/dhcpd/icmp.c b/usr.sbin/dhcpd/icmp.c
index 271dd2ea379..ba39edc5bea 100644
--- a/usr.sbin/dhcpd/icmp.c
+++ b/usr.sbin/dhcpd/icmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: icmp.c,v 1.7 2004/04/21 22:44:35 henning Exp $ */
+/* $OpenBSD: icmp.c,v 1.8 2004/04/22 15:22:48 henning Exp $ */
/*
* Copyright (c) 1997, 1998 The Internet Software Consortium.
@@ -95,12 +95,7 @@ icmp_echorequest(struct iaddr *addr)
icmp.icmp_code = 0;
icmp.icmp_cksum = 0;
icmp.icmp_seq = 0;
-#ifdef PTRSIZE_64BIT
- icmp.icmp_id = (((u_int32_t) (u_int64_t) addr) ^
- (u_int32_t) (((u_int64_t) addr) >> 32));
-#else
- icmp.icmp_id = (u_int32_t) addr;
-#endif
+ icmp.icmp_id = getpid() & 0xffff;
icmp.icmp_cksum = wrapsum(checksum((unsigned char *)&icmp,
sizeof(icmp), 0));