Changeset ede63e4 in mainline for uspace/srv/net/tl/icmp
- Timestamp:
- 2010-01-04T23:25:48Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- eac9722
- Parents:
- 1a0fb3f8
- Location:
- uspace/srv/net/tl/icmp
- Files:
-
- 2 edited
-
icmp.c (modified) (3 diffs)
-
icmp_header.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tl/icmp/icmp.c
r1a0fb3f8 rede63e4 350 350 // TODO do not ask all the time 351 351 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 ); 353 353 if( ! packet ) return ENOMEM; 354 354 … … 548 548 } 549 549 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; 552 552 // get configuration 553 553 icmp_globals.error_reporting = NET_DEFAULT_ICMP_ERROR_REPORTING; … … 610 610 length = packet_get_data_length( packet ); 611 611 if( length <= 0 ) return EINVAL; 612 if( length < sizeof( icmp_header_t )) return EINVAL;612 if( length < ICMP_HEADER_SIZE) return EINVAL; 613 613 data = packet_get_data( packet ); 614 614 if( ! data ) return EINVAL; -
uspace/srv/net/tl/icmp/icmp_header.h
r1a0fb3f8 rede63e4 43 43 #include "../../include/in.h" 44 44 #include "../../include/icmp_codes.h" 45 46 /** ICMP header size in bytes. 47 */ 48 #define ICMP_HEADER_SIZE sizeof( icmp_header_t ) 45 49 46 50 /** Type definition of the echo specific data.
Note:
See TracChangeset
for help on using the changeset viewer.
