Changeset 15791 in vbox for trunk/src/VBox/Devices/Network/slirp
- Timestamp:
- Jan 5, 2009 10:30:45 AM (16 years ago)
- Location:
- trunk/src/VBox/Devices/Network/slirp
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/ip_icmp.c
r15676 r15791 140 140 # endif /* VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */ 141 141 pData->szIcmpBuffer = sizeof(ICMP_ECHO_REPLY) * 10; 142 pData->pvIcmpBuffer = malloc(pData->szIcmpBuffer);142 pData->pvIcmpBuffer = RTMemAlloc(pData->szIcmpBuffer); 143 143 #endif /* RT_OS_WINDOWS */ 144 144 LIST_INIT(&pData->icmp_msg_head); … … 249 249 if (found == 1 && icm == NULL) 250 250 { 251 icm = malloc(sizeof(struct icmp_msg));251 icm = RTMemAlloc(sizeof(struct icmp_msg)); 252 252 icm->im_m = so->so_m; 253 253 icm->im_so = so; … … 273 273 ip = mtod(m, struct ip *); 274 274 Assert(ip->ip_p == IPPROTO_ICMP); 275 icm = malloc(sizeof(struct icmp_msg));275 icm = RTMemAlloc(sizeof(struct icmp_msg)); 276 276 icm->im_m = m; 277 277 LIST_INSERT_HEAD(&pData->icmp_msg_head, icm, im_list); -
trunk/src/VBox/Devices/Network/slirp/ip_input.c
r15636 r15791 308 308 if (fp == NULL) 309 309 { 310 fp = malloc(sizeof(struct ipq_t));310 fp = RTMemAlloc(sizeof(struct ipq_t)); 311 311 if (fp == NULL) 312 312 goto dropfrag; -
trunk/src/VBox/Devices/Network/slirp/mbuf.c
r15453 r15791 57 57 if (m_freelist.m_next == &m_freelist) 58 58 { 59 m = (struct mbuf *) malloc(msize);59 m = (struct mbuf *)RTMemAlloc(msize); 60 60 if (m == NULL) 61 61 goto end_error; … … 103 103 /* If it's M_EXT, free() it */ 104 104 if (m->m_flags & M_EXT) 105 free(m->m_ext);105 RTMemFree(m->m_ext); 106 106 107 107 /* … … 110 110 if (m->m_flags & M_DOFREE) 111 111 { 112 free(m);112 RTMemFree(m); 113 113 mbuf_alloced--; 114 114 } … … 155 155 { 156 156 datasize = m->m_data - m->m_ext; 157 m->m_ext = (char *) realloc(m->m_ext, size);157 m->m_ext = (char *)RTMemRealloc(m->m_ext, size); 158 158 #if 0 159 159 if (m->m_ext == NULL) … … 166 166 char *dat; 167 167 datasize = m->m_data - m->m_dat; 168 dat = (char *) malloc(size);168 dat = (char *)RTMemAlloc(size); 169 169 #if 0 170 170 if (dat == NULL) -
trunk/src/VBox/Devices/Network/slirp/misc.c
r15453 r15791 70 70 71 71 tmp_ptr = *ex_ptr; 72 *ex_ptr = (struct ex_list *) malloc(sizeof(struct ex_list));72 *ex_ptr = (struct ex_list *)RTMemAlloc(sizeof(struct ex_list)); 73 73 (*ex_ptr)->ex_fport = port; 74 74 (*ex_ptr)->ex_addr = addr; 75 75 (*ex_ptr)->ex_pty = do_pty; 76 (*ex_ptr)->ex_exec = strdup(exec);76 (*ex_ptr)->ex_exec = RTStrDup(exec); 77 77 (*ex_ptr)->ex_next = tmp_ptr; 78 78 return 0; -
trunk/src/VBox/Devices/Network/slirp/sbuf.c
r15293 r15791 19 19 sbfree(struct sbuf *sb) 20 20 { 21 free(sb->sb_data);21 RTMemFree(sb->sb_data); 22 22 } 23 23 … … 46 46 if (sb->sb_datalen != size) 47 47 { 48 sb->sb_wptr = sb->sb_rptr = sb->sb_data = (char *)realloc(sb->sb_data, size); 48 sb->sb_wptr = 49 sb->sb_rptr = 50 sb->sb_data = (char *)RTMemRealloc(sb->sb_data, size); 49 51 sb->sb_cc = 0; 50 52 if (sb->sb_wptr) … … 56 58 else 57 59 { 58 sb->sb_wptr = sb->sb_rptr = sb->sb_data = (char *) malloc(size);60 sb->sb_wptr = sb->sb_rptr = sb->sb_data = (char *)RTMemAlloc(size); 59 61 sb->sb_cc = 0; 60 62 if (sb->sb_wptr) -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r15769 r15791 337 337 { 338 338 int fNATfailed = 0; 339 PNATState pData = malloc(sizeof(NATState));339 PNATState pData = RTMemAlloc(sizeof(NATState)); 340 340 *ppData = pData; 341 341 if (!pData) … … 1070 1070 { 1071 1071 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC 1072 uint8_t *buf = malloc(1600); /* XXX:temporal solution */1072 uint8_t *buf = RTMemAlloc(1600); /* XXX:temporal solution */ 1073 1073 struct ethhdr *eh = (struct ethhdr *)buf; 1074 1074 -
trunk/src/VBox/Devices/Network/slirp/slirp.h
r15575 r15791 28 28 #define LOG_GROUP LOG_GROUP_DRV_NAT 29 29 #include <VBox/log.h> 30 #ifdef VBOX_WITH_SLIRP_MEMORY_CHECK31 # define RTMEM_WRAP_TO_EF_APIS32 #endif /* VBOX_WITH_SLIRP_MEMORY_CHECK */33 30 #include <iprt/mem.h> 34 31 #ifdef RT_OS_WINDOWS … … 41 38 #include <VBox/types.h> 42 39 43 #define malloc(a) RTMemAlloc(a) 44 #define free(a) RTMemFree(a) 45 #define realloc(a,b) RTMemRealloc(a, b) 40 #undef malloc 41 #define malloc dont_use_malloc 42 #undef free 43 #define free(a) dont_use_free 44 #undef realloc 45 #define realloc(a,b) dont_use_realloc 46 #undef strdup 47 #define strdup(a) dont_use_strdup 46 48 47 49 #include "slirp_config.h" … … 168 170 #ifdef GETTIMEOFDAY_ONE_ARG 169 171 # define gettimeofday(x, y) gettimeofday(x) 170 #endif171 172 /* Systems lacking strdup() definition in <string.h>. */173 #if defined(ultrix)174 char *strdup _P((const char *));175 #endif176 177 /* Systems lacking malloc() definition in <stdlib.h>. */178 #if defined(ultrix) || defined(hcx)179 void *malloc _P((size_t arg));180 void free _P((void *ptr));181 172 #endif 182 173 -
trunk/src/VBox/Devices/Network/slirp/slirp_config.h
r14964 r15791 52 52 */ 53 53 54 /* Ignore this */55 #undef DUMMY_PPP56 57 54 #ifdef _MSC_VER 58 55 #undef HAVE_UNISTD_H -
trunk/src/VBox/Devices/Network/slirp/socket.c
r15672 r15791 60 60 struct socket *so; 61 61 62 so = (struct socket *) malloc(sizeof(struct socket));62 so = (struct socket *)RTMemAlloc(sizeof(struct socket)); 63 63 if(so) 64 64 { -
trunk/src/VBox/Devices/Network/slirp/tcp_input.c
r15472 r15791 115 115 * just drop the pkt. 116 116 */ 117 te = malloc(sizeof(struct tseg_qent));117 te = RTMemAlloc(sizeof(struct tseg_qent)); 118 118 if (te == NULL) 119 119 { -
trunk/src/VBox/Devices/Network/slirp/tcp_subr.c
r15453 r15791 186 186 register struct tcpcb *tp; 187 187 188 tp = (struct tcpcb *) malloc(sizeof(*tp));188 tp = (struct tcpcb *)RTMemAlloc(sizeof(*tp)); 189 189 if (tp == NULL) 190 190 return ((struct tcpcb *)0); -
trunk/src/VBox/Devices/Network/slirp/udp.c
r15636 r15791 564 564 { 565 565 /* no entry for so, create new */ 566 req = (struct talk_request *) malloc(sizeof(struct talk_request));566 req = (struct talk_request *)RTMemAlloc(sizeof(struct talk_request)); 567 567 req->udp_so = so; 568 568 req->tcp_so = solisten(0,
Note:
See TracChangeset
for help on using the changeset viewer.