Index: uspace/lib/net/include/icmp_header.h
===================================================================
--- uspace/lib/net/include/icmp_header.h	(revision f1938c6a0868df384a77e996a1b661825126d1bf)
+++ uspace/lib/net/include/icmp_header.h	(revision ffaba005466528a7a5b086e69d421b1d6c7d97d9)
@@ -45,26 +45,16 @@
 
 /** ICMP header size in bytes. */
-#define ICMP_HEADER_SIZE	sizeof(icmp_header_t)
-
-/** Type definition of the echo specific data.
- * @see icmp_echo
- */
-typedef struct icmp_echo icmp_echo_t;
+#define ICMP_HEADER_SIZE  sizeof(icmp_header_t)
 
 /** Echo specific data. */
-struct icmp_echo {
+typedef struct icmp_echo {
 	/** Message idintifier. */
 	icmp_param_t identifier;
 	/** Message sequence number. */
 	icmp_param_t sequence_number;
-} __attribute__ ((packed));
-
-/** Type definition of the internet control message header.
- * @see icmp_header
- */
-typedef struct icmp_header icmp_header_t;
+} __attribute__((packed)) icmp_echo_t;
 
 /** Internet control message header. */
-struct icmp_header {
+typedef struct icmp_header {
 	/** The type of the message. */
 	uint8_t type;
@@ -83,9 +73,9 @@
 	 */
 	uint16_t checksum;
-
+	
 	/** Message specific data. */
 	union {
 		/** Echo specific data. */
-		icmp_echo_t  echo;
+		icmp_echo_t echo;
 		/** Proposed gateway value. */
 		in_addr_t gateway;
@@ -107,5 +97,5 @@
 		} param;
 	} un;
-} __attribute__ ((packed));
+} __attribute__((packed)) icmp_header_t;
 
 #endif
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)
