Changeset ede63e4 in mainline for uspace/srv/net/tl/icmp/icmp.c


Ignore:
Timestamp:
2010-01-04T23:25:48Z (14 years ago)
Author:
Lukas Mejdrech <lukasmejdrech@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
eac9722
Parents:
1a0fb3f8
Message:
  • socket identifier generation moved to libsocket, + data fragment size fix and enhancement, + [ICMP|TCP|UDP]_HEADER_SIZE definition, + int_map_update() function to alter item key
File:
1 edited

Legend:

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

    r1a0fb3f8 rede63e4  
    350350        // TODO do not ask all the time
    351351        ERROR_PROPAGATE( ip_packet_size_req( icmp_globals.ip_phone, -1, & icmp_globals.addr_len, & icmp_globals.prefix, & icmp_globals.content, & icmp_globals.suffix ));
    352         packet = packet_get_4( icmp_globals.net_phone, size, icmp_globals.addr_len, sizeof( icmp_header_t ) + icmp_globals.prefix, icmp_globals.suffix );
     352        packet = packet_get_4( icmp_globals.net_phone, size, icmp_globals.addr_len, ICMP_HEADER_SIZE + icmp_globals.prefix, icmp_globals.suffix );
    353353        if( ! packet ) return ENOMEM;
    354354
     
    548548        }
    549549        ERROR_PROPAGATE( ip_packet_size_req( icmp_globals.ip_phone, -1, & icmp_globals.addr_len, & icmp_globals.prefix, & icmp_globals.content, & icmp_globals.suffix ));
    550         icmp_globals.prefix += sizeof( icmp_header_t );
    551         icmp_globals.content -= sizeof( icmp_header_t );
     550        icmp_globals.prefix += ICMP_HEADER_SIZE;
     551        icmp_globals.content -= ICMP_HEADER_SIZE;
    552552        // get configuration
    553553        icmp_globals.error_reporting = NET_DEFAULT_ICMP_ERROR_REPORTING;
     
    610610        length = packet_get_data_length( packet );
    611611        if( length <= 0 ) return EINVAL;
    612         if( length < sizeof( icmp_header_t )) return EINVAL;
     612        if( length < ICMP_HEADER_SIZE) return EINVAL;
    613613        data = packet_get_data( packet );
    614614        if( ! data ) return EINVAL;
Note: See TracChangeset for help on using the changeset viewer.