Index: uspace/srv/net/inetsrv/inet_link.c
===================================================================
--- uspace/srv/net/inetsrv/inet_link.c	(revision fc4bf2a68893d755d03c377d242f982ce35c09db)
+++ uspace/srv/net/inetsrv/inet_link.c	(revision 313824a3373e4159b53978621bf1d3ece6a5e02f)
@@ -52,4 +52,7 @@
 static bool first_link6 = true;
 
+static FIBRIL_MUTEX_INITIALIZE(ip_ident_lock);
+static uint16_t ip_ident = 0;
+
 static int inet_link_open(service_id_t);
 static int inet_iplink_recv(iplink_t *, iplink_recv_sdu_t *, uint16_t);
@@ -366,10 +369,16 @@
 	packet.proto = proto;
 	packet.ttl = ttl;
+	
+	/* Allocate identifier */
+	fibril_mutex_lock(&ip_ident_lock);
+	packet.ident = ++ip_ident;
+	fibril_mutex_unlock(&ip_ident_lock);
+	
 	packet.df = df;
 	packet.data = dgram->data;
 	packet.size = dgram->size;
 	
+	int rc;
 	size_t offs = 0;
-	int rc;
 	
 	do {
@@ -421,4 +430,10 @@
 	packet.proto = proto;
 	packet.ttl = ttl;
+	
+	/* Allocate identifier */
+	fibril_mutex_lock(&ip_ident_lock);
+	packet.ident = ++ip_ident;
+	fibril_mutex_unlock(&ip_ident_lock);
+	
 	packet.df = df;
 	packet.data = dgram->data;
Index: uspace/srv/net/inetsrv/inet_std.h
===================================================================
--- uspace/srv/net/inetsrv/inet_std.h	(revision fc4bf2a68893d755d03c377d242f982ce35c09db)
+++ uspace/srv/net/inetsrv/inet_std.h	(revision 313824a3373e4159b53978621bf1d3ece6a5e02f)
@@ -48,5 +48,5 @@
 	/** Total Length */
 	uint16_t tot_len;
-	/** Identification */
+	/** Identifier */
 	uint16_t id;
 	/** Flags, Fragment Offset */
@@ -126,5 +126,5 @@
 	/** Fragmentation offset, reserved and M flag */
 	uint16_t offsmf;
-	/** Identification */
+	/** Identifier */
 	uint32_t id;
 } ip6_header_fragment_t;
Index: uspace/srv/net/inetsrv/inetsrv.h
===================================================================
--- uspace/srv/net/inetsrv/inetsrv.h	(revision fc4bf2a68893d755d03c377d242f982ce35c09db)
+++ uspace/srv/net/inetsrv/inetsrv.h	(revision 313824a3373e4159b53978621bf1d3ece6a5e02f)
@@ -113,5 +113,5 @@
 	uint8_t ttl;
 	/** Identifier */
-	uint16_t ident;
+	uint32_t ident;
 	/** Do not fragment */
 	bool df;
Index: uspace/srv/net/inetsrv/pdu.c
===================================================================
--- uspace/srv/net/inetsrv/pdu.c	(revision fc4bf2a68893d755d03c377d242f982ce35c09db)
+++ uspace/srv/net/inetsrv/pdu.c	(revision 313824a3373e4159b53978621bf1d3ece6a5e02f)
@@ -49,6 +49,4 @@
 #include "pdu.h"
 
-static FIBRIL_MUTEX_INITIALIZE(ip_ident_lock);
-static uint16_t ip_ident = 0;
 
 /** One's complement addition.
@@ -107,5 +105,5 @@
  */
 int inet_pdu_encode(inet_packet_t *packet, addr32_t src, addr32_t dest,
-   size_t offs, size_t mtu, void **rdata, size_t *rsize, size_t *roffs)
+    size_t offs, size_t mtu, void **rdata, size_t *rsize, size_t *roffs)
 {
 	/* Upper bound for fragment offset field */
@@ -152,9 +150,4 @@
 		return ENOMEM;
 	
-	/* Allocate identifier */
-	fibril_mutex_lock(&ip_ident_lock);
-	uint16_t ident = ++ip_ident;
-	fibril_mutex_unlock(&ip_ident_lock);
-	
 	/* Encode header fields */
 	ip_header_t *hdr = (ip_header_t *) data;
@@ -164,5 +157,5 @@
 	hdr->tos = packet->tos;
 	hdr->tot_len = host2uint16_t_be(size);
-	hdr->id = host2uint16_t_be(ident);
+	hdr->id = host2uint16_t_be(packet->ident);
 	hdr->flags_foff = host2uint16_t_be(flags_foff);
 	hdr->ttl = packet->ttl;
@@ -259,13 +252,4 @@
 		return ENOMEM;
 	
-#if 0
-	// FIXME TODO fragmentation
-	
-	/* Allocate identifier */
-	fibril_mutex_lock(&ip_ident_lock);
-	uint16_t ident = ++ip_ident;
-	fibril_mutex_unlock(&ip_ident_lock);
-#endif
-	
 	/* Encode header fields */
 	ip6_header_t *hdr6 = (ip6_header_t *) data;
