- Timestamp:
- Nov 12, 2010 5:14:26 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/udp.c
r30363 r34034 338 338 register struct udpiphdr *ui; 339 339 int error; 340 int mlen = 0; 340 341 341 342 DEBUG_CALL("udp_output"); … … 350 351 m->m_data -= sizeof(struct udpiphdr); 351 352 m->m_len += sizeof(struct udpiphdr); 353 mlen = m_length(m, NULL); 352 354 353 355 /* … … 358 360 memset(ui->ui_x1, 0, 9); 359 361 ui->ui_pr = IPPROTO_UDP; 360 ui->ui_len = RT_H2N_U16(m ->m_len - sizeof(struct ip));362 ui->ui_len = RT_H2N_U16(mlen - sizeof(struct ip)); 361 363 /* XXXXX Check for from-one-location sockets, or from-any-location sockets */ 362 364 ui->ui_src = saddr->sin_addr; … … 372 374 if (udpcksum) 373 375 { 374 if ((ui->ui_sum = cksum(m, /* sizeof (struct udpiphdr) + */ m ->m_len)) == 0)376 if ((ui->ui_sum = cksum(m, /* sizeof (struct udpiphdr) + */ mlen)) == 0) 375 377 ui->ui_sum = 0xffff; 376 378 } 377 ((struct ip *)ui)->ip_len = m ->m_len;379 ((struct ip *)ui)->ip_len = mlen; 378 380 ((struct ip *)ui)->ip_ttl = ip_defttl; 379 381 ((struct ip *)ui)->ip_tos = iptos;
Note:
See TracChangeset
for help on using the changeset viewer.