Changeset 257feec in mainline for uspace/srv/net/inetsrv/pdu.c
- Timestamp:
- 2013-06-27T12:48:32Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9f391e9
- Parents:
- 679ee84
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/inetsrv/pdu.c
r679ee84 r257feec 203 203 204 204 log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_pdu_decode()"); 205 205 206 206 if (size < sizeof(ip_header_t)) { 207 207 log_msg(LOG_DEFAULT, LVL_DEBUG, "PDU too short (%zu)", size); … … 223 223 return EINVAL; 224 224 } 225 225 226 226 if (tot_len > size) { 227 227 log_msg(LOG_DEFAULT, LVL_DEBUG, "Total Length = %zu > PDU size = %zu", … … 242 242 packet->ttl = hdr->ttl; 243 243 packet->ident = ident; 244 244 245 245 packet->df = (flags_foff & BIT_V(uint16_t, FF_FLAG_DF)) != 0; 246 246 packet->mf = (flags_foff & BIT_V(uint16_t, FF_FLAG_MF)) != 0; 247 247 packet->offs = foff * FRAG_OFFS_UNIT; 248 248 249 249 /* XXX IP options */ 250 250 data_offs = sizeof(uint32_t) * BIT_RANGE_EXTRACT(uint8_t, VI_IHL_h, … … 257 257 return ENOMEM; 258 258 } 259 260 memcpy(packet->data, (uint8_t *) data + data_offs, packet->size);261 259 260 memcpy(packet->data, (uint8_t *) data + data_offs, packet->size); 261 262 262 return EOK; 263 263 }
Note:
See TracChangeset
for help on using the changeset viewer.