Changeset a2d8d59 in mainline for uspace/srv


Ignore:
Timestamp:
2011-01-17T16:26:10Z (14 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7e36c8d
Parents:
f1938c6 (diff), ffaba00 (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 ICMP rewrite

File:
1 edited

Legend:

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

    rf1938c6 ra2d8d59  
    123123static bool error_reporting = true;
    124124static bool echo_replying = true;
     125static packet_dimension_t icmp_dimension;
    125126
    126127/** ICMP client identification counter */
    127128static atomic_t icmp_client;
    128 static packet_dimension_t icmp_dimension;
    129 
    130 /** ICMP identifier and sequence number */
     129
     130/** ICMP identifier and sequence number (client-specific) */
    131131static fibril_local icmp_param_t icmp_id;
    132132static fibril_local icmp_param_t icmp_seq;
     
    142142         * are 16-bit values.
    143143         */
    144         hash_index_t index = (key[0] & 0xffff) << 16 | (key[1] & 0xffff);
    145         return index % REPLY_BUCKETS;
     144        hash_index_t index = ((key[0] & 0xffff) << 16) | (key[1] & 0xffff);
     145        return (index % REPLY_BUCKETS);
    146146}
    147147
     
    209209        header->type = type;
    210210        header->code = code;
     211       
     212        /*
     213         * The checksum needs to be calculated
     214         * with a virtual checksum field set to
     215         * zero.
     216         */
    211217        header->checksum = 0;
    212218        header->checksum = ICMP_CHECKSUM(header,
     
    281287 *         zero.
    282288 * @return ENOMEM if there is not enough memory left.
    283  * @return EPARTY if there was an internal error.
    284289 *
    285290 */
     
    328333        }
    329334       
    330         bzero(header, sizeof(*header));
     335        bzero(header, sizeof(icmp_header_t));
    331336        header->un.echo.identifier = id;
    332337        header->un.echo.sequence_number = sequence;
     
    439444        unsigned long key[REPLY_KEYS] =
    440445            {header->un.echo.identifier, header->un.echo.sequence_number};
     446       
     447        /* The packet is no longer needed */
    441448        icmp_release(packet);
    442449       
     
    698705/** Per-connection initialization
    699706 *
     707 * Initialize client-specific global variables.
     708 *
    700709 */
    701710void tl_connection(void)
Note: See TracChangeset for help on using the changeset viewer.