Ignore:
Timestamp:
2011-07-20T15:26:21Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
efcebe1
Parents:
25bef0ff (diff), a701812 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/net/generic/packet_client.c

    r25bef0ff r6a44ee4  
    247247}
    248248
    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 
     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 */
     261packet_t *packet_get_copy(async_sess_t *sess, packet_t *packet)
     262{
     263        if (!packet_is_valid(packet))
     264                return NULL;
     265       
    269266        /* Get a new packet */
    270         copy = packet_get_4_remote(phone, PACKET_DATA_LENGTH(packet),
     267        packet_t *copy = packet_get_4_remote(sess, PACKET_DATA_LENGTH(packet),
    271268            PACKET_MAX_ADDRESS_LENGTH(packet), packet->max_prefix,
    272269            PACKET_MIN_SUFFIX(packet));
     270       
    273271        if (!copy)
    274272                return NULL;
    275 
     273       
    276274        /* Get addresses */
    277         addrlen = packet_get_addr(packet, &src, &dest);
     275        uint8_t *src = NULL;
     276        uint8_t *dest = NULL;
     277        size_t addrlen = packet_get_addr(packet, &src, &dest);
     278       
    278279        /* Copy data */
    279280        if ((packet_copy_data(copy, packet_get_data(packet),
     
    286287                return copy;
    287288        } else {
    288                 pq_release_remote(phone, copy->packet_id);
     289                pq_release_remote(sess, copy->packet_id);
    289290                return NULL;
    290291        }
Note: See TracChangeset for help on using the changeset viewer.