Changeset 1796 in vbox for trunk/src/VBox/Devices/Network/slirp
- Timestamp:
- Mar 29, 2007 12:43:54 PM (18 years ago)
- Location:
- trunk/src/VBox/Devices/Network/slirp
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/ctl.h
r1 r1796 3 3 #define CTL_ALIAS 2 4 4 #define CTL_DNS 3 5 #define CTL_BROADCAST 255 5 6 6 7 #define CTL_SPECIAL "10.0.2.0" -
trunk/src/VBox/Devices/Network/slirp/socket.c
r1076 r1796 484 484 int ret; 485 485 struct sockaddr_in addr; 486 struct sockaddr_in host_addr; 486 487 487 488 DEBUG_CALL("sosendto"); … … 493 494 /* It's an alias */ 494 495 switch(ntohl(so->so_faddr.s_addr) & 0xff) { 496 case CTL_BROADCAST: 497 addr.sin_addr.s_addr = INADDR_BROADCAST; 498 /* Send the packet to host to fully emulate broadcast */ 499 /** @todo r=klaus: on Linux host this causes the host to receive 500 * the packet twice for some reason. And I cannot find any place 501 * in the man pages which states that sending a broadcast does not 502 * reach the host itself. */ 503 host_addr.sin_family = AF_INET; 504 host_addr.sin_port = so->so_fport; 505 host_addr.sin_addr = loopback_addr; 506 sendto(so->s, m->m_data, m->m_len, 0, 507 (struct sockaddr *)&host_addr, sizeof (struct sockaddr)); 508 break; 495 509 case CTL_DNS: 496 510 addr.sin_addr = dns_addr; -
trunk/src/VBox/Devices/Network/slirp/udp.c
r1789 r1796 337 337 #endif 338 338 } else { 339 int opt = 1; 339 340 /* success, insert in queue */ 340 341 so->so_expire = curtime + SO_EXPIRE; 342 /* enable broadcast for later use */ 343 setsockopt(so->s, SOL_SOCKET, SO_BROADCAST, &opt, sizeof(opt)); 341 344 insque(pData, so,&udb); 342 345 }
Note:
See TracChangeset
for help on using the changeset viewer.