Changeset 63014 in vbox for trunk/src/VBox/Devices/Network/slirp
- Timestamp:
- Aug 4, 2016 9:56:04 PM (8 years ago)
- Location:
- trunk/src/VBox/Devices/Network/slirp
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/hostres.c
r62511 r63014 175 175 { 176 176 struct response *res; 177 size_t mlen;177 u_int mlen; 178 178 int rc; 179 179 … … 380 380 381 381 m->m_len = 0; 382 ok = m_append(pData, m, res->end, (c_caddr_t)res->buf);382 ok = m_append(pData, m, (int)res->end, (c_caddr_t)res->buf); 383 383 if (!ok) 384 384 { … … 536 536 if (off < res->qlen) 537 537 { 538 int trailer = res->qlen - off;538 ssize_t trailer = res->qlen - off; 539 539 540 540 LogDbg(("NAT: hostres: question %zu < mlen %zu\n", off, res->qlen)); … … 751 751 752 752 out: 753 pHdr->ancount = RT_H2N_U16( nanswers);753 pHdr->ancount = RT_H2N_U16((uint16_t)nanswers); 754 754 return VINF_SUCCESS; 755 755 } … … 768 768 size_t nanswers; 769 769 ssize_t nbytes; 770 int i;771 770 772 771 pHdr = (struct dnsmsg_header *)res->buf; … … 791 790 */ 792 791 { 793 PDNSMAPPINGENTRY pReverseMapping = getDNSMapByAddr(res->pData, &in_addr_arpa.s_addr);792 PDNSMAPPINGENTRY pReverseMapping = getDNSMapByAddr(res->pData, (const uint32_t *)&in_addr_arpa.s_addr); 794 793 if (pReverseMapping != NULL) 795 794 { … … 813 812 if (h == NULL) 814 813 { 814 #ifdef RT_OS_WINDOWS 815 h = gethostbyaddr((const char *)&in_addr_arpa, sizeof(struct in_addr), AF_INET); 816 #else 815 817 h = gethostbyaddr(&in_addr_arpa, sizeof(struct in_addr), AF_INET); 818 #endif 816 819 } 817 820 … … 848 851 849 852 out: 850 pHdr->ancount = RT_H2N_U16( nanswers);853 pHdr->ancount = RT_H2N_U16((uint16_t)nanswers); 851 854 return VINF_SUCCESS; 852 855 } … … 1189 1192 struct label *l; 1190 1193 int i; 1194 RT_ZERO(addr); /* makes MSC happy*/ 1191 1195 1192 1196 l = root; -
trunk/src/VBox/Devices/Network/slirp/libalias/alias.c
r61905 r63014 162 162 uint8_t *c = p; 163 163 164 #if 164 #ifdef RT_LITTLE_ENDIAN //BYTE_ORDER == LITTLE_ENDIAN 165 165 uint16_t s1 = ((uint16_t)c[1] << 8) + (uint16_t)c[0]; 166 166 uint16_t s2 = ((uint16_t)c[3] << 8) + (uint16_t)c[2]; … … 977 977 int proxy_type, error; 978 978 u_short dest_port; 979 u_short proxy_server_port ;979 u_short proxy_server_port = 0; /* Shut up MSC. */ 980 980 struct in_addr dest_address; 981 981 struct in_addr proxy_server_address; -
trunk/src/VBox/Devices/Network/slirp/libalias/alias_db.c
r52712 r63014 2278 2278 #else 2279 2279 Log2(("NAT: PacketAlias/InitPacketAliasLog: Packet alias logging enabled.\n")); 2280 la->logDesc = (void *) 1; /* XXX: in vbox we don't use this param */2280 la->logDesc = (void *)(uintptr_t)1; /* XXX: in vbox we don't use this param */ 2281 2281 #endif 2282 2282 la->packetAliasMode |= PKT_ALIAS_LOG; -
trunk/src/VBox/Devices/Network/slirp/tftp.c
r62511 r63014 254 254 char *pszTftpRRQRaw; 255 255 size_t idxTftpRRQRaw = 0; 256 int cbTftpRRQRaw = 0;256 ssize_t cbTftpRRQRaw = 0; 257 257 int fWithArg = 0; 258 258 int idxOptionArg = 0; … … 263 263 pszTftpRRQRaw = (char *)&pcTftpIpHeader->Core; 264 264 cbTftpRRQRaw = RT_H2N_U16(pcTftpIpHeader->UdpHdr.uh_ulen) + sizeof(struct ip) - RT_OFFSETOF(TFTPIPHDR, Core); 265 while (cbTftpRRQRaw)265 while (cbTftpRRQRaw) 266 266 { 267 267 idxTftpRRQRaw = RTStrNLen(pszTftpRRQRaw, 512 - idxTftpRRQRaw) + 1; … … 327 327 } 328 328 pszTftpRRQRaw += idxTftpRRQRaw; 329 cbTftpRRQRaw -= idxTftpRRQRaw;329 cbTftpRRQRaw -= idxTftpRRQRaw; 330 330 } 331 331 … … 538 538 { 539 539 char aszOptionBuffer[256]; 540 size_t iOptLength = 0;540 size_t iOptLength; 541 541 int rc = VINF_SUCCESS; 542 542 int cbMBufCurrent = pMBuf->m_len; … … 546 546 547 547 RT_ZERO(aszOptionBuffer); 548 iOptLength += RTStrPrintf(aszOptionBuffer, 256 , "%s", pszOptName) + 1;548 iOptLength = RTStrPrintf(aszOptionBuffer, 256 , "%s", pszOptName) + 1; 549 549 iOptLength += RTStrPrintf(aszOptionBuffer + iOptLength, 256 - iOptLength , "%llu", u64OptValue) + 1; 550 550 if (iOptLength > M_TRAILINGSPACE(pMBuf)) … … 552 552 else 553 553 { 554 pMBuf->m_len += iOptLength;555 m_copyback(pData, pMBuf, cbMBufCurrent, iOptLength, aszOptionBuffer);554 pMBuf->m_len += (int)iOptLength; 555 m_copyback(pData, pMBuf, cbMBufCurrent, (int)iOptLength, aszOptionBuffer); 556 556 } 557 557 LogFlowFuncLeaveRC(rc); … … 609 609 struct mbuf *m = NULL; 610 610 PTFTPIPHDR pTftpIpHeader = NULL; 611 u_int cbMsg = (u_int)strlen(msg) + 1; /* ending zero */ 611 612 612 613 LogFlowFunc(("ENTER: errorcode: %RX16, msg: %s\n", errorcode, msg)); … … 619 620 620 621 m->m_data += if_maxlinkhdr; 621 m->m_len = sizeof(TFTPIPHDR) 622 + strlen(msg) + 1; /* ending zero */ 622 m->m_len = sizeof(TFTPIPHDR) + cbMsg; 623 623 m->m_pkthdr.header = mtod(m, void *); 624 624 pTftpIpHeader = mtod(m, PTFTPIPHDR); … … 627 627 pTftpIpHeader->Core.u16TftpOpCode = RT_H2N_U16(errorcode); 628 628 629 m_copyback(pData, m, sizeof(TFTPIPHDR), strlen(msg) + 1 /* copy ending zerro*/, (c_caddr_t)msg);629 m_copyback(pData, m, sizeof(TFTPIPHDR), cbMsg, (c_caddr_t)msg); 630 630 631 631 tftpSend(pData, pTftpSession, m, pcTftpIpHeaderRecv);
Note:
See TracChangeset
for help on using the changeset viewer.