- Timestamp:
- Nov 24, 2014 2:28:53 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/ip_icmpwin.c
r53360 r53380 115 115 { 116 116 struct ip *ip = mtod(m, struct ip *); 117 int icmplen = ip->ip_len - hlen;117 size_t reqsize; 118 118 uint8_t ttl; 119 119 size_t bufsize; … … 122 122 IP_OPTION_INFORMATION opts; 123 123 void *reqdata; 124 size_t reqsize;125 124 int status; 126 125 … … 129 128 --ttl; 130 129 131 bufsize = sizeof(ICMP_ECHO_REPLY) + icmplen; 130 reqsize = ip->ip_len - hlen - sizeof(struct icmp_echo); 131 132 bufsize = sizeof(ICMP_ECHO_REPLY); 133 if (reqsize < sizeof(IO_STATUS_BLOCK) + sizeof(struct icmp_echo)) 134 bufsize += sizeof(IO_STATUS_BLOCK) + sizeof(struct icmp_echo); 135 else 136 bufsize += reqsize; 137 bufsize += 16; /* whatever that is; empirically at least XP needs it */ 138 LogRel(("NAT: ping size=%d bufsize=%d\n", (int)reqsize, (int)bufsize)); 139 132 140 pong = RTMemAlloc(RT_OFFSETOF(struct pong, buf) + bufsize); 133 141 if (RT_UNLIKELY(pong == NULL)) … … 140 148 AssertReturnVoid(pong->reqicmph.icmp_type == ICMP_ECHO); 141 149 142 reqsize = icmplen - sizeof(struct icmp_echo); /* just the payload */143 150 if (m->m_next == NULL) 144 151 {
Note:
See TracChangeset
for help on using the changeset viewer.