Changes in uspace/lib/net/generic/packet_client.c [6b82009:28a3e74] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/net/generic/packet_client.c
r6b82009 r28a3e74 247 247 } 248 248 249 /** Return the packet copy. 250 * 251 * Copy the addresses, data, order and metric values. 252 * Queue placement is not copied. 253 * 254 * @param[in] sess Packet server module session. 255 * @param[in] packet Original packet. 256 * 257 * @return Packet copy. 258 * @return NULL on error. 259 * 260 */ 261 packet_t *packet_get_copy(async_sess_t *sess, packet_t *packet) 262 { 263 if (!packet_is_valid(packet)) 264 return NULL; 265 249 /** Returns the packet copy. 250 * 251 * Copies the addresses, data, order and metric values. 252 * Does not copy the queue placement. 253 * 254 * @param[in] phone The packet server module phone. 255 * @param[in] packet The original packet. 256 * @return The packet copy. 257 * @return NULL on error. 258 */ 259 packet_t *packet_get_copy(int phone, packet_t *packet) 260 { 261 packet_t *copy; 262 uint8_t * src = NULL; 263 uint8_t * dest = NULL; 264 size_t addrlen; 265 266 if (!packet_is_valid(packet)) 267 return NULL; 268 266 269 /* Get a new packet */ 267 packet_t *copy = packet_get_4_remote(sess, PACKET_DATA_LENGTH(packet),270 copy = packet_get_4_remote(phone, PACKET_DATA_LENGTH(packet), 268 271 PACKET_MAX_ADDRESS_LENGTH(packet), packet->max_prefix, 269 272 PACKET_MIN_SUFFIX(packet)); 270 271 273 if (!copy) 272 274 return NULL; 273 275 274 276 /* Get addresses */ 275 uint8_t *src = NULL; 276 uint8_t *dest = NULL; 277 size_t addrlen = packet_get_addr(packet, &src, &dest); 278 277 addrlen = packet_get_addr(packet, &src, &dest); 279 278 /* Copy data */ 280 279 if ((packet_copy_data(copy, packet_get_data(packet), … … 287 286 return copy; 288 287 } else { 289 pq_release_remote( sess, copy->packet_id);288 pq_release_remote(phone, copy->packet_id); 290 289 return NULL; 291 290 }
Note:
See TracChangeset
for help on using the changeset viewer.