Changeset 47506 in vbox
- Timestamp:
- Aug 1, 2013 12:08:51 PM (11 years ago)
- Location:
- trunk/src/VBox/Devices/Network
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DrvNAT.cpp
r47499 r47506 60 60 * Defined Constants And Macros * 61 61 *******************************************************************************/ 62 63 #define DRVNAT_MAXFRAMESIZE (16 * 1024) 62 64 63 65 /** … … 466 468 if (!pGso) 467 469 { 470 /* 471 * Drop the frame if it is too big. 472 */ 473 if (cbMin >= DRVNAT_MAXFRAMESIZE) 474 { 475 Log(("drvNATNetowrkUp_AllocBuf: drops over-sized frame (%u bytes), returns VERR_INVALID_PARAMETER\n", 476 cbMin)); 477 return VERR_INVALID_PARAMETER; 478 } 479 468 480 pSgBuf->pvUser = NULL; 469 481 pSgBuf->pvAllocator = slirp_ext_m_get(pThis->pNATState, cbMin, … … 477 489 else 478 490 { 491 /* 492 * Drop the frame if its segment is too big. 493 */ 494 if (pGso->cbHdrsTotal + pGso->cbMaxSeg >= DRVNAT_MAXFRAMESIZE) 495 { 496 Log(("drvNATNetowrkUp_AllocBuf: drops over-sized frame (%u bytes), returns VERR_INVALID_PARAMETER\n", 497 pGso->cbHdrsTotal + pGso->cbMaxSeg)); 498 return VERR_INVALID_PARAMETER; 499 } 500 479 501 pSgBuf->pvUser = RTMemDup(pGso, sizeof(*pGso)); 480 502 pSgBuf->pvAllocator = NULL; -
trunk/src/VBox/Devices/Network/slirp/ip_icmp.c
r46593 r47506 613 613 register struct icmp *icp; 614 614 register struct mbuf *m; 615 int new_ip_size = 0; 615 616 int new_m_size = 0; 616 617 int size = 0; … … 653 654 } 654 655 655 new_m_size = sizeof(struct ip) + ICMP_MINLEN + msrc->m_len + ICMP_MAXDATALEN; 656 new_ip_size = sizeof(struct ip) + ICMP_MINLEN + ICMP_MAXDATALEN; 657 new_m_size = if_maxlinkhdr + new_ip_size; 656 658 if (new_m_size < MSIZE) 657 659 size = MCLBYTES; … … 671 673 m->m_pkthdr.header = mtod(m, void *); 672 674 673 m emcpy(m->m_data, msrc->m_data, msrc->m_len);674 m ->m_len = msrc->m_len;/* copy msrc to m */675 m->m_len = msrc->m_len < new_ip_size ? msrc->m_len : new_ip_size; 676 memcpy(m->m_data, msrc->m_data, m->m_len); /* copy msrc to m */ 675 677 676 678 /* make the header of the reply packet */
Note:
See TracChangeset
for help on using the changeset viewer.