Rev 4726 | Rev 4738 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4726 | Rev 4731 | ||
---|---|---|---|
Line 97... | Line 97... | ||
97 | default: |
97 | default: |
98 | return EAFNOSUPPORT; |
98 | return EAFNOSUPPORT; |
99 | } |
99 | } |
100 | } |
100 | } |
101 | 101 | ||
102 | void tl_send_icmp_port_unreachable( int packet_phone, int icmp_phone, packet_t packet, services_t error ){ |
102 | int tl_prepare_icmp_packet( int packet_phone, int icmp_phone, packet_t packet, services_t error ){ |
103 | packet_t next; |
103 | packet_t next; |
104 | uint8_t * src; |
104 | uint8_t * src; |
105 | int length; |
105 | int length; |
106 | 106 | ||
107 | // detach the first packet and release the others |
107 | // detach the first packet and release the others |
Line 113... | Line 113... | ||
113 | if(( length > 0 ) |
113 | if(( length > 0 ) |
114 | && ( ! error ) |
114 | && ( ! error ) |
115 | && ( icmp_phone >= 0 ) |
115 | && ( icmp_phone >= 0 ) |
116 | // set both addresses to the source one (avoids the source address deletion before setting the destination one) |
116 | // set both addresses to the source one (avoids the source address deletion before setting the destination one) |
117 | && ( packet_set_addr( packet, src, src, ( size_t ) length ) == EOK )){ |
117 | && ( packet_set_addr( packet, src, src, ( size_t ) length ) == EOK )){ |
118 | icmp_destination_unreachable_msg( icmp_phone, ICMP_PORT_UNREACH, 0, packet ); |
118 | return EOK; |
119 | }else{ |
119 | }else{ |
120 | pq_release( packet_phone, packet_get_id( packet )); |
120 | pq_release( packet_phone, packet_get_id( packet )); |
121 | } |
121 | } |
- | 122 | return ENOENT; |
|
122 | } |
123 | } |
123 | 124 | ||
124 | int tl_socket_read_packet_data( int packet_phone, packet_ref packet, size_t prefix, const packet_dimension_ref dimension, const struct sockaddr * addr, socklen_t addrlen ){ |
125 | int tl_socket_read_packet_data( int packet_phone, packet_ref packet, size_t prefix, const packet_dimension_ref dimension, const struct sockaddr * addr, socklen_t addrlen ){ |
125 | ERROR_DECLARE; |
126 | ERROR_DECLARE; |
126 | 127 |