Changeset 13896 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Nov 6, 2008 2:50:51 AM (16 years ago)
- Location:
- trunk/src/VBox/Devices/Network/slirp
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/if.c
r13783 r13896 191 191 ifq = if_batchq.ifq_prev; 192 192 while(1){ 193 if (ifq == &if_batchq ) {193 if (ifq == &if_batchq || ifq == NULL) { 194 194 VBOX_SLIRP_UNLOCK(pData->if_batchq_mutex); 195 195 break; … … 198 198 #endif 199 199 VBOX_SLIRP_UNLOCK(pData->if_batchq_mutex); 200 if (so == ifq->ifq_so ) {200 if (so == ifq->ifq_so && ifq->ifs_prev != NULL ) { 201 201 /* A match! */ 202 202 ifm->ifq_so = so; … … 235 235 ifm->ifq_so = so; 236 236 ifs_init(ifm); 237 if (ifq != NULL) 237 238 insque(pData, ifm, ifq); 238 239 … … 373 374 374 375 /* If there are more packets for this session, re-queue them */ 375 if (ifm->ifs_next != /* ifm->ifs_prev != */ ifm && ifm->ifs_next != NULL) { 376 if (ifm->ifs_next != /* ifm->ifs_prev != */ ifm 377 && ifm->ifs_next != NULL 378 && ifqt != NULL) { 376 379 insque(pData, ifm->ifs_next, ifqt); 377 380 ifs_remque(ifm); … … 388 391 if_encap(pData, (const uint8_t *)ifm->m_data, ifm->m_len); 389 392 393 #ifdef VBOX_WITH_SYNC_SLIRP 394 if (ifm != &if_fastq 395 && ifm != &if_batchq 396 && ifm != &m_freelist 397 && ifm != &m_usedlist) 398 #endif 390 399 m_free(pData, ifm); 391 400 -
trunk/src/VBox/Devices/Network/slirp/mbuf.c
r13783 r13896 16 16 */ 17 17 18 #define IN_MBUF 18 19 #include <slirp.h> 19 20 … … 110 111 { 111 112 113 VBOX_QUEUE_EDGE_CHECK(m); 112 114 DEBUG_CALL("m_free"); 113 115 DEBUG_ARG("m = %lx", (long )m); … … 117 119 if (m->m_flags & M_USEDLIST) { 118 120 VBOX_SLIRP_LOCK(pData->m_usedlist_mutex); 119 remque(pData, m); 121 if (m->m_next != NULL && m->m_prev != NULL) 122 remque(pData, m); 120 123 VBOX_SLIRP_UNLOCK(pData->m_usedlist_mutex); 121 124 } … … 157 160 * If there's no room, realloc 158 161 */ 159 162 VBOX_QUEUE_EDGE_CHECK(m); 163 VBOX_QUEUE_EDGE_CHECK(n); 160 164 if (M_FREEROOM(m) < n->m_len) 161 165 m_inc(m,m->m_size+MINCSIZE); … … 254 258 { 255 259 struct mbuf *m; 260 #ifdef VBOX_WITH_SYNC_SLIRP 261 struct mbuf *mnext; 262 #endif 256 263 257 264 DEBUG_CALL("dtom"); … … 262 269 for (m = m_usedlist.m_next; m != &m_usedlist; m = m->m_next) { 263 270 #else 264 struct mbuf *mnext;265 271 VBOX_SLIRP_LOCK(pData->m_usedlist_mutex); 266 272 m = m_usedlist.m_next; -
trunk/src/VBox/Devices/Network/slirp/mbuf.h
r13783 r13896 151 151 struct mbuf * dtom _P((PNATState, void *)); 152 152 153 #ifdef VBOX_WITH_SYNC_SLIRP 154 #define VBOX_QUEUE_EDGE_CHECK(x) \ 155 do { \ 156 AssertRelease((x) != &m_freelist); \ 157 AssertRelease((x) != &m_usedlist); \ 158 AssertRelease((x) != &if_fastq); \ 159 AssertRelease((x) != &if_batchq); \ 160 } while(0) 161 #ifndef IN_MBUF 162 #define m_inc(a, b) \ 163 do { \ 164 VBOX_QUEUE_EDGE_CHECK((a)); \ 165 m_inc((a),(b)); \ 166 } while (0) 167 168 #define m_adj(a, b) \ 169 do { \ 170 VBOX_QUEUE_EDGE_CHECK((a)); \ 171 m_adj((a), (b)); \ 172 } while (0) 173 174 #ifndef RT_OS_WINDOWS 175 #define m_copy(a, b, c, d) \ 176 ({ \ 177 VBOX_QUEUE_EDGE_CHECK((a)); \ 178 VBOX_QUEUE_EDGE_CHECK((b)); \ 179 m_copy((a), (b), (c), (d)); \ 180 }) 153 181 #endif 182 #endif /*IN_MBUF*/ 183 #else 184 #define VBOX_QUEUE_EDGE_CHECK(x) /*ignore*/ 185 #endif 186 187 #endif -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r13783 r13896 378 378 while (1) { 379 379 tcp_loop_begin: 380 if (so == &tcb ) {380 if (so == &tcb || so == NULL) { 381 381 VBOX_SLIRP_UNLOCK(pData->tcb_mutex); 382 382 break; … … 568 568 while (1) { 569 569 loop_begin: 570 if (so == &tcb ) {570 if (so == &tcb || so == NULL) { 571 571 VBOX_SLIRP_UNLOCK(pData->tcb_mutex); 572 572 break;
Note:
See TracChangeset
for help on using the changeset viewer.