Changeset 61201 in vbox
- Timestamp:
- May 26, 2016 1:49:38 AM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 107489
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/ip_input.c
r59063 r61201 191 191 goto free_m; 192 192 193 /* check ip_ttl for a correct ICMP reply */194 if (ip->ip_ttl==0 || ip->ip_ttl == 1)195 {196 /* XXX: if we're in destination so perhaps we need to send ICMP_TIMXCEED_REASS */197 icmp_error(pData, m, ICMP_TIMXCEED, ICMP_TIMXCEED_INTRANS, 0, "ttl");198 goto no_free_m;199 }200 201 ip->ip_ttl--;202 if (ip->ip_sum > RT_H2N_U16_C(0xffffU - (1 << 8)))203 ip->ip_sum += RT_H2N_U16_C(1 << 8) + 1;204 else205 ip->ip_sum += RT_H2N_U16_C(1 << 8);206 207 193 /* 208 194 * Drop multicast (class d) and reserved (class e) here. The rest … … 215 201 goto free_m; 216 202 } 203 204 205 /* do we need to "forward" this packet? */ 206 if (!CTL_CHECK_MINE(ip->ip_dst.s_addr)) 207 { 208 if (ip->ip_ttl <= 1) 209 { 210 icmp_error(pData, m, ICMP_TIMXCEED, ICMP_TIMXCEED_INTRANS, 0, "ttl"); 211 goto no_free_m; 212 } 213 214 /* ignore packets to other nodes from our private network */ 215 if ( CTL_CHECK_NETWORK(ip->ip_dst.s_addr) 216 && !CTL_CHECK_BROADCAST(ip->ip_dst.s_addr)) 217 { 218 /* XXX: send ICMP_REDIRECT_HOST to be pedantic? */ 219 goto free_m; 220 } 221 222 ip->ip_ttl--; 223 if (ip->ip_sum > RT_H2N_U16_C(0xffffU - (1 << 8))) 224 ip->ip_sum += RT_H2N_U16_C(1 << 8) + 1; 225 else 226 ip->ip_sum += RT_H2N_U16_C(1 << 8); 227 } 228 217 229 218 230 /*
Note:
See TracChangeset
for help on using the changeset viewer.