--- src/comp/c_generic.c 2010-08-22 14:00:49 +0000 +++ src/comp/c_generic.c 2011-05-11 15:43:40 +0000 @@ -5937,8 +5939,8 @@ { uint16_t id; - /* always transmit IP-ID in Network Byte Order */ - id = ipv4_get_id_nbo(ip, g_context->ip_flags.info.v4.nbo); + /* IP-ID is compressed, even 16bit sent, see RFC 4815 8.2 */ + id = htons((uint16_t)(g_context->ip_flags.info.v4.id_delta & 0xffff)); memcpy(&dest[counter], &id, 2); rohc_debugf(3, "IP ID = 0x%02x 0x%02x\n", dest[counter], dest[counter + 1]); @@ -6014,8 +6016,8 @@ { uint16_t id; - /* always transmit IP-ID in Network Byte Order */ - id = ipv4_get_id_nbo(ip2, g_context->ip2_flags.info.v4.nbo); + /* IP-ID is compressed, even 16bit sent, see RFC 4815 8.2 */ + id = htons((uint16_t)(g_context->ip_flags.info.v4.id_delta & 0xffff)); memcpy(&dest[counter], &id, 2); rohc_debugf(3, "IP ID = 0x%02x 0x%02x\n", dest[counter], dest[counter + 1]); --- src/decomp/d_generic.c 2010-08-22 17:16:24 +0000 +++ src/decomp/d_generic.c 2011-05-11 11:33:21 +0000 @@ -5100,7 +5113,13 @@ if(g_context->multiple_ip) { - ipv4_set_id(&active2->ip, GET_NEXT_16_BITS(packet)); + uint16_t id; + + id = GET_NEXT_16_BITS(packet); + id = ntohs(id); + id = d_ip_id_decode(&g_context->ip_id2, id, 16, *sn); + id = htons(id); + ipv4_set_id(&active2->ip, id); rohc_debugf(3, "inner IP-ID changed (0x%04x)\n", ntohs(ipv4_get_id(&active2->ip))); packet += 2; @@ -5110,7 +5129,13 @@ } else { - ipv4_set_id(&active1->ip, GET_NEXT_16_BITS(packet)); + uint16_t id; + + id = GET_NEXT_16_BITS(packet); + id = ntohs(id); + id = d_ip_id_decode(&g_context->ip_id1, id, 16, *sn); + id = htons(id); + ipv4_set_id(&active1->ip, id); rohc_debugf(3, "outer IP-ID changed (0x%04x)\n", ntohs(ipv4_get_id(&active1->ip))); packet += 2;