Ignore:
File:
1 edited

Legend:

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

    rffaba00 rf1938c6  
    123123static bool error_reporting = true;
    124124static bool echo_replying = true;
    125 static packet_dimension_t icmp_dimension;
    126125
    127126/** ICMP client identification counter */
    128127static atomic_t icmp_client;
    129 
    130 /** ICMP identifier and sequence number (client-specific) */
     128static packet_dimension_t icmp_dimension;
     129
     130/** ICMP identifier and sequence number */
    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          */
    217211        header->checksum = 0;
    218212        header->checksum = ICMP_CHECKSUM(header,
     
    287281 *         zero.
    288282 * @return ENOMEM if there is not enough memory left.
     283 * @return EPARTY if there was an internal error.
    289284 *
    290285 */
     
    333328        }
    334329       
    335         bzero(header, sizeof(icmp_header_t));
     330        bzero(header, sizeof(*header));
    336331        header->un.echo.identifier = id;
    337332        header->un.echo.sequence_number = sequence;
     
    444439        unsigned long key[REPLY_KEYS] =
    445440            {header->un.echo.identifier, header->un.echo.sequence_number};
    446        
    447         /* The packet is no longer needed */
    448441        icmp_release(packet);
    449442       
     
    705698/** Per-connection initialization
    706699 *
    707  * Initialize client-specific global variables.
    708  *
    709700 */
    710701void tl_connection(void)
Note: See TracChangeset for help on using the changeset viewer.