Index: uspace/srv/net/tl/icmp/icmp.c
===================================================================
--- uspace/srv/net/tl/icmp/icmp.c	(revision f1938c6a0868df384a77e996a1b661825126d1bf)
+++ uspace/srv/net/tl/icmp/icmp.c	(revision ffaba005466528a7a5b086e69d421b1d6c7d97d9)
@@ -123,10 +123,10 @@
 static bool error_reporting = true;
 static bool echo_replying = true;
+static packet_dimension_t icmp_dimension;
 
 /** ICMP client identification counter */
 static atomic_t icmp_client;
-static packet_dimension_t icmp_dimension;
-
-/** ICMP identifier and sequence number */
+
+/** ICMP identifier and sequence number (client-specific) */
 static fibril_local icmp_param_t icmp_id;
 static fibril_local icmp_param_t icmp_seq;
@@ -142,6 +142,6 @@
 	 * are 16-bit values.
 	 */
-	hash_index_t index = (key[0] & 0xffff) << 16 | (key[1] & 0xffff);
-	return index % REPLY_BUCKETS;
+	hash_index_t index = ((key[0] & 0xffff) << 16) | (key[1] & 0xffff);
+	return (index % REPLY_BUCKETS);
 }
 
@@ -209,4 +209,10 @@
 	header->type = type;
 	header->code = code;
+	
+	/*
+	 * The checksum needs to be calculated
+	 * with a virtual checksum field set to
+	 * zero.
+	 */
 	header->checksum = 0;
 	header->checksum = ICMP_CHECKSUM(header,
@@ -281,5 +287,4 @@
  *         zero.
  * @return ENOMEM if there is not enough memory left.
- * @return EPARTY if there was an internal error.
  *
  */
@@ -328,5 +333,5 @@
 	}
 	
-	bzero(header, sizeof(*header));
+	bzero(header, sizeof(icmp_header_t));
 	header->un.echo.identifier = id;
 	header->un.echo.sequence_number = sequence;
@@ -439,4 +444,6 @@
 	unsigned long key[REPLY_KEYS] =
 	    {header->un.echo.identifier, header->un.echo.sequence_number};
+	
+	/* The packet is no longer needed */
 	icmp_release(packet);
 	
@@ -698,4 +705,6 @@
 /** Per-connection initialization
  *
+ * Initialize client-specific global variables.
+ *
  */
 void tl_connection(void)
