Changeset 313824a in mainline for uspace/srv/net/inetsrv/pdu.c
- Timestamp:
- 2013-07-16T17:05:30Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1f97352
- Parents:
- fc4bf2a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/inetsrv/pdu.c
rfc4bf2a r313824a 49 49 #include "pdu.h" 50 50 51 static FIBRIL_MUTEX_INITIALIZE(ip_ident_lock);52 static uint16_t ip_ident = 0;53 51 54 52 /** One's complement addition. … … 107 105 */ 108 106 int inet_pdu_encode(inet_packet_t *packet, addr32_t src, addr32_t dest, 109 size_t offs, size_t mtu, void **rdata, size_t *rsize, size_t *roffs)107 size_t offs, size_t mtu, void **rdata, size_t *rsize, size_t *roffs) 110 108 { 111 109 /* Upper bound for fragment offset field */ … … 152 150 return ENOMEM; 153 151 154 /* Allocate identifier */155 fibril_mutex_lock(&ip_ident_lock);156 uint16_t ident = ++ip_ident;157 fibril_mutex_unlock(&ip_ident_lock);158 159 152 /* Encode header fields */ 160 153 ip_header_t *hdr = (ip_header_t *) data; … … 164 157 hdr->tos = packet->tos; 165 158 hdr->tot_len = host2uint16_t_be(size); 166 hdr->id = host2uint16_t_be( ident);159 hdr->id = host2uint16_t_be(packet->ident); 167 160 hdr->flags_foff = host2uint16_t_be(flags_foff); 168 161 hdr->ttl = packet->ttl; … … 259 252 return ENOMEM; 260 253 261 #if 0262 // FIXME TODO fragmentation263 264 /* Allocate identifier */265 fibril_mutex_lock(&ip_ident_lock);266 uint16_t ident = ++ip_ident;267 fibril_mutex_unlock(&ip_ident_lock);268 #endif269 270 254 /* Encode header fields */ 271 255 ip6_header_t *hdr6 = (ip6_header_t *) data;
Note:
See TracChangeset
for help on using the changeset viewer.