Index: uspace/lib/c/generic/net/packet.c
===================================================================
--- uspace/lib/c/generic/net/packet.c	(revision 00d7e1bfe06501df61aed156666d5597397d910a)
+++ uspace/lib/c/generic/net/packet.c	(revision bf08ff09ceff5d890ec7d268061dc52502fe2100)
@@ -139,11 +139,13 @@
 packet_t *pm_find(packet_id_t packet_id)
 {
-	packet_t *packet;
 	if (!packet_id)
 		return NULL;
-
+	
 	fibril_rwlock_read_lock(&pm_globals.lock);
-	link_t *link =
-	    hash_table_find(&pm_globals.packet_map, &packet_id);
+	
+	unsigned long key = packet_id;
+	link_t *link = hash_table_find(&pm_globals.packet_map, &key);
+	
+	packet_t *packet;
 	if (link != NULL) {
 		pm_entry_t *entry =
@@ -172,5 +174,6 @@
 	
 	fibril_rwlock_write_lock(&pm_globals.lock);
-	pm_entry_t *entry = malloc(sizeof (pm_entry_t));
+	
+	pm_entry_t *entry = malloc(sizeof(pm_entry_t));
 	if (entry == NULL) {
 		fibril_rwlock_write_unlock(&pm_globals.lock);
@@ -179,7 +182,10 @@
 	
 	entry->packet = packet;
-	hash_table_insert(&pm_globals.packet_map, &packet->packet_id,
-	    &entry->link);
+	
+	unsigned long key = packet->packet_id;
+	hash_table_insert(&pm_globals.packet_map, &key, &entry->link);
+	
 	fibril_rwlock_write_unlock(&pm_globals.lock);
+	
 	return EOK;
 }
@@ -195,5 +201,8 @@
 	
 	fibril_rwlock_write_lock(&pm_globals.lock);
-	hash_table_remove(&pm_globals.packet_map, &packet->packet_id, 1);
+	
+	unsigned long key = packet->packet_id;
+	hash_table_remove(&pm_globals.packet_map, &key, 1);
+	
 	fibril_rwlock_write_unlock(&pm_globals.lock);
 }
Index: uspace/lib/c/include/net/packet.h
===================================================================
--- uspace/lib/c/include/net/packet.h	(revision 00d7e1bfe06501df61aed156666d5597397d910a)
+++ uspace/lib/c/include/net/packet.h	(revision bf08ff09ceff5d890ec7d268061dc52502fe2100)
@@ -38,8 +38,10 @@
 #define LIBC_PACKET_H_
 
+#include <sys/types.h>
+
 /** Packet identifier type.
  * Value zero is used as an invalid identifier.
  */
-typedef unsigned long packet_id_t;
+typedef sysarg_t packet_id_t;
 
 /** Type definition of the packet.
@@ -51,5 +53,5 @@
  * @see packet_dimension
  */
-typedef struct packet_dimension	packet_dimension_t;
+typedef struct packet_dimension packet_dimension_t;
 
 /** Packet dimension. */
