Changeset e50cd7f in mainline for uspace/srv/net/tl/udp/udp.c


Ignore:
Timestamp:
2011-04-17T19:17:55Z (14 years ago)
Author:
Matej Klonfar <maklf@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
63517c2, cfbbe1d3
Parents:
ef354b6 (diff), 8595577b (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:

new report structure fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/tl/udp/udp.c

    ref354b6 re50cd7f  
    499499        device_id_t device_id;
    500500        packet_dimension_t *packet_dimension;
     501        size_t size;
    501502        int rc;
     503
     504        /* In case of error, do not update the data fragment size. */
     505        *data_fragment_size = 0;
    502506       
    503507        rc = tl_get_address_port(addr, addrlen, &dest_port);
     
    539543                packet_dimension = &udp_globals.packet_dimension;
    540544//      }
     545
     546        /*
     547         * Update the data fragment size based on what the lower layers can
     548         * handle without fragmentation, but not more than the maximum allowed
     549         * for UDP.
     550         */
     551        size = MAX_UDP_FRAGMENT_SIZE;
     552        if (packet_dimension->content < size)
     553            size = packet_dimension->content;
     554        *data_fragment_size = size;
    541555
    542556        /* Read the first packet fragment */
     
    740754        int socket_id;
    741755        size_t addrlen;
    742         size_t size = 0;
     756        size_t size;
    743757        ipc_call_t answer;
    744758        size_t answer_count;
     
    786800                                break;
    787801                       
     802                        size = MAX_UDP_FRAGMENT_SIZE;
    788803                        if (tl_get_ip_packet_dimension(udp_globals.ip_phone,
    789804                            &udp_globals.dimensions, DEVICE_INVALID_ID,
    790805                            &packet_dimension) == EOK) {
    791                                 SOCKET_SET_DATA_FRAGMENT_SIZE(answer,
    792                                     packet_dimension->content);
     806                                if (packet_dimension->content < size)
     807                                        size = packet_dimension->content;
    793808                        }
    794 
    795 //                      SOCKET_SET_DATA_FRAGMENT_SIZE(answer,
    796 //                          MAX_UDP_FRAGMENT_SIZE);
     809                        SOCKET_SET_DATA_FRAGMENT_SIZE(answer, size);
    797810                        SOCKET_SET_HEADER_SIZE(answer, UDP_HEADER_SIZE);
    798811                        answer_count = 3;
Note: See TracChangeset for help on using the changeset viewer.