- Timestamp:
- May 10, 2012 6:10:17 AM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 77873
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/socket.c
r41198 r41227 183 183 sofree(PNATState pData, struct socket *so) 184 184 { 185 LogFlowFunc(("ENTER:%R[natsock]\n", so)); 186 /* 187 * We should not remove socket when polling routine do the polling 188 * instead we mark it for deletion. 189 */ 190 if (so->fUnderPolling) 191 { 192 so->fShouldBeRemoved = 1; 193 LogFlowFunc(("LEAVE:%R[natsock] postponed deletion\n", so)); 194 return; 195 } 185 196 if (so == tcp_last_so) 186 197 tcp_last_so = &tcb; 187 198 else if (so == udp_last_so) 188 199 udp_last_so = &udb; 200 201 #ifndef VBOX_WITH_SLIRP_MT 202 189 203 /* libalias notification */ 190 204 if (so->so_pvLnk) 191 205 slirpDeleteLinkSocket(so->so_pvLnk); 192 193 206 /* check if mbuf haven't been already freed */ 194 207 if (so->so_m != NULL) 208 { 195 209 m_freem(pData, so->so_m); 196 #ifndef VBOX_WITH_SLIRP_MT 197 /* 198 * We should not remove socket when polling routine do the polling 199 * instead we mark it for deletion. 200 */ 201 if (!so->fUnderPolling) 202 { 203 if (so->so_next && so->so_prev) 204 { 205 remque(pData, so); /* crashes if so is not in a queue */ 206 NSOCK_DEC(); 207 } 208 209 RTMemFree(so); 210 } 211 else 212 so->fShouldBeRemoved = 1; 210 so->so_m = NULL; 211 } 212 213 if (so->so_next && so->so_prev) 214 { 215 remque(pData, so); /* crashes if so is not in a queue */ 216 NSOCK_DEC(); 217 } 218 219 RTMemFree(so); 213 220 #else 214 221 so->so_deleted = 1; 215 222 #endif 223 LogFlowFuncLeave(); 216 224 } 217 225
Note:
See TracChangeset
for help on using the changeset viewer.