Changeset 63013 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Aug 4, 2016 9:42:42 PM (8 years ago)
- Location:
- trunk/src/VBox/Devices/Network/slirp
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/socket.c
r62692 r63013 135 135 136 136 void 137 so_init( )137 so_init(void) 138 138 { 139 139 } … … 163 163 */ 164 164 struct socket * 165 socreate( )165 socreate(void) 166 166 { 167 167 struct socket *so; … … 241 241 int n, nn, lss, total; 242 242 struct sbuf *sb = &so->so_snd; 243 size_t len = sb->sb_datalen - sb->sb_cc;243 u_int len = sb->sb_datalen - sb->sb_cc; 244 244 struct iovec iov[2]; 245 245 int mss = so->so_tcpcb->t_maxseg; … … 392 392 * A return of -1 wont (shouldn't) happen, since it didn't happen above 393 393 */ 394 if (n == 2 && nn == iov[0].iov_len)394 if (n == 2 && (unsigned)nn == iov[0].iov_len) 395 395 { 396 396 int ret; … … 530 530 int n, nn; 531 531 struct sbuf *sb = &so->so_rcv; 532 size_t len = sb->sb_cc;532 u_int len = sb->sb_cc; 533 533 struct iovec iov[2]; 534 534 … … 634 634 635 635 #ifndef HAVE_READV 636 if (n == 2 && nn == iov[0].iov_len)636 if (n == 2 && (unsigned)nn == iov[0].iov_len) 637 637 { 638 638 int ret; … … 694 694 #endif /* !RT_OS_WINDOWS */ 695 695 { 696 static uint8_t au8Buf[64 * 1024];696 static char achBuf[64 * 1024]; 697 697 698 698 /* A "normal" UDP packet */ … … 724 724 725 725 /* large packets will spill into a temp buffer */ 726 iov[1].iov_base = a u8Buf;727 iov[1].iov_len = sizeof(a u8Buf);726 iov[1].iov_base = achBuf; 727 iov[1].iov_len = sizeof(achBuf); 728 728 729 729 #if !defined(RT_OS_WINDOWS) … … 742 742 { 743 743 DWORD nbytes; /* NB: can't use nread b/c of different size */ 744 DWORD flags ;744 DWORD flags = 0; 745 745 int status; 746 747 flags = 0; 748 status = WSARecvFrom(so->s, iov, 2, &nbytes, &flags, 746 AssertCompile(sizeof(WSABUF) == sizeof(struct iovec)); 747 AssertCompileMembersSameSizeAndOffset(WSABUF, len, struct iovec, iov_len); 748 AssertCompileMembersSameSizeAndOffset(WSABUF, buf, struct iovec, iov_base); 749 status = WSARecvFrom(so->s, (WSABUF *)&iov[0], 2, &nbytes, &flags, 749 750 (struct sockaddr *)&addr, &addrlen, 750 751 NULL, NULL); -
trunk/src/VBox/Devices/Network/slirp/tcp_input.c
r62511 r63013 294 294 caddr_t optp = NULL; 295 295 int optlen = 0; 296 int len, tlen, off; 296 int len, off; 297 int tlen = 0; /* Shut up MSC (didn't check whether MSC was right). */ 297 298 register struct tcpcb *tp = 0; 298 299 register int tiflags; … … 303 304 u_long tiwin; 304 305 /* int ts_present = 0; */ 305 size_tohdrlen;306 unsigned ohdrlen; 306 307 uint8_t ohdr[60 + 8]; /* max IP header plus 8 bytes of payload for icmp */ 307 308 … … 360 361 361 362 /* ip_input() subtracts iphlen from ip::ip_len */ 362 AssertStmt( (ip->ip_len + iphlen == m_length(m, NULL)), goto drop);363 AssertStmt(ip->ip_len + iphlen == (ssize_t)m_length(m, NULL), goto drop); 363 364 if (RT_UNLIKELY(ip->ip_len < sizeof(struct tcphdr))) 364 365 { … … 1784 1785 { 1785 1786 struct ip *oip; 1786 size_tohdrlen;1787 unsigned ohdrlen; 1787 1788 struct mbuf *m; 1788 1789 -
trunk/src/VBox/Devices/Network/slirp/tcp_output.c
r62511 r63013 439 439 * a PUSH comes in.) 440 440 */ 441 if (off + len == SBUF_LEN(&so->so_snd))441 if (off + len == (ssize_t)SBUF_LEN(&so->so_snd)) 442 442 flags |= TH_PUSH; 443 443 } … … 540 540 { 541 541 memcpy((caddr_t)(ti + 1), (caddr_t)opt, optlen); 542 ti->ti_off = ( sizeof (struct tcphdr) + optlen) >> 2;542 ti->ti_off = (uint8_t)((sizeof (struct tcphdr) + optlen) >> 2); 543 543 } 544 544 ti->ti_flags = flags; -
trunk/src/VBox/Devices/Network/slirp/tcp_subr.c
r62511 r63013 315 315 316 316 void 317 tcp_drain( )317 tcp_drain(void) 318 318 { 319 319 /* XXX */ -
trunk/src/VBox/Devices/Network/slirp/udp.c
r62511 r63013 334 334 * can't use IP_HDRINCL here as it's only valid for SOCK_RAW. 335 335 */ 336 # define USE_DF_OPTION(_Optname) \ 337 const int dfopt = _Optname; \ 338 const char * const dfoptname = #_Optname; 336 # define USE_DF_OPTION(_Optname) \ 337 const int dfopt = _Optname 339 338 #if defined(IP_MTU_DISCOVER) 340 339 USE_DF_OPTION(IP_MTU_DISCOVER); … … 434 433 memset(ui->ui_x1, 0, 9); 435 434 ui->ui_pr = IPPROTO_UDP; 436 ui->ui_len = RT_H2N_U16( mlen - sizeof(struct ip));435 ui->ui_len = RT_H2N_U16((uint16_t)(mlen - sizeof(struct ip))); 437 436 /* XXXXX Check for from-one-location sockets, or from-any-location sockets */ 438 437 ui->ui_src = saddr->sin_addr;
Note:
See TracChangeset
for help on using the changeset viewer.