Subversion Repositories HelenOS

Rev

Rev 4707 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4707 Rev 4708
Line 212... Line 212...
212
 
212
 
213
    return EOK;
213
    return EOK;
214
}
214
}
215
 
215
 
216
int icmp_process_packet( packet_t packet ){
216
int icmp_process_packet( packet_t packet ){
217
    int             length;
217
    size_t          length;
-
 
218
    int             result;
218
    void *          data;
219
    void *          data;
219
    icmp_header_ref header;
220
    icmp_header_ref header;
220
 
221
 
221
    // get rid of the ip header
222
    // get rid of the ip header
222
    length = ip_client_process_packet( packet, NULL, NULL, NULL, NULL, NULL );
223
    result = ip_client_process_packet( packet, NULL, NULL, NULL, NULL, NULL );
223
    if( length < 0 ) return length;
224
    if( result < 0 ) return result;
224
    packet_trim( packet, length, 0 );
225
    packet_trim( packet, ( size_t ) result, 0 );
225
 
226
 
226
    length = packet_get_data_length( packet );
227
    length = packet_get_data_length( packet );
227
    if( length <= 0 ) return EINVAL;
228
    if( length <= 0 ) return EINVAL;
228
    if( length < sizeof( icmp_header_t )) return EINVAL;
229
    if( length < sizeof( icmp_header_t )) return EINVAL;
229
    data = packet_get_data( packet );
230
    data = packet_get_data( packet );