Changeset 57251 in vbox for trunk/src/VBox/HostDrivers
- Timestamp:
- Aug 8, 2015 11:09:49 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetFlt/darwin/VBoxNetFlt-darwin.cpp
r56723 r57251 1463 1463 u_int32_t if_unit = ifnet_unit(pIfNet); 1464 1464 1465 for (;;) { 1465 for (;;) 1466 { 1466 1467 mbuf_t m; 1467 size_t len = sizeof(struct kern_event_msg) - sizeof(u_int32_t) 1468 + sizeof(struct kev_in6_data); 1468 size_t len = sizeof(struct kern_event_msg) - sizeof(u_int32_t) + sizeof(struct kev_in6_data); 1469 1469 1470 1470 error = sock_receivembuf(pSysSock, NULL, &m, 0, &len); 1471 if (error == EWOULDBLOCK) 1472 { 1473 Log(("vboxNetFltDarwinSysSockUpcall: EWOULDBLOCK - we are done\n")); 1474 error = 0; 1471 if (error != 0) 1472 { 1473 if (error == EWOULDBLOCK) 1474 { 1475 Log(("vboxNetFltDarwinSysSockUpcall: EWOULDBLOCK - we are done\n")); 1476 error = 0; 1477 } 1478 else 1479 Log(("sock_receivembuf: error %d\n", error)); 1475 1480 break; 1476 1481 } 1477 else if (error != 0)1478 {1479 Log(("sock_receivembuf: error %d\n", error));1480 break;1481 }1482 1482 1483 1483 if (len < sizeof(struct kern_event_msg) - sizeof(u_int32_t)) 1484 1484 { 1485 Log(("vboxNetFltDarwinSysSockUpcall: %u bytes is too short\n", 1486 (unsigned int)len)); 1485 Log(("vboxNetFltDarwinSysSockUpcall: %u bytes is too short\n", (unsigned int)len)); 1487 1486 mbuf_freem(m); 1488 1487 return; … … 1521 1520 { 1522 1521 case KEV_INET_NEW_ADDR: 1523 Log(("KEV_INET_NEW_ADDR %.*s%d: %RTnaipv4\n", 1524 IFNAMSIZ, link->if_name, link->if_unit, pAddr->IPv4.u)); 1525 1526 pThis->pSwitchPort->pfnNotifyHostAddress(pThis->pSwitchPort, 1527 /* :fAdded */ true, kIntNetAddrType_IPv4, pAddr); 1522 Log(("KEV_INET_NEW_ADDR %.*s%d: %RTnaipv4\n", IFNAMSIZ, link->if_name, link->if_unit, pAddr->IPv4.u)); 1523 pThis->pSwitchPort->pfnNotifyHostAddress(pThis->pSwitchPort, true /*fAdded*/, kIntNetAddrType_IPv4, pAddr); 1528 1524 break; 1529 1525 1530 1526 case KEV_INET_ADDR_DELETED: 1531 Log(("KEV_INET_ADDR_DELETED %.*s%d: %RTnaipv4\n", 1532 IFNAMSIZ, link->if_name, link->if_unit, pAddr->IPv4.u)); 1533 1534 pThis->pSwitchPort->pfnNotifyHostAddress(pThis->pSwitchPort, 1535 /* :fAdded */ false, kIntNetAddrType_IPv4, pAddr); 1527 Log(("KEV_INET_ADDR_DELETED %.*s%d: %RTnaipv4\n", IFNAMSIZ, link->if_name, link->if_unit, pAddr->IPv4.u)); 1528 pThis->pSwitchPort->pfnNotifyHostAddress(pThis->pSwitchPort, false /*fAdded*/, kIntNetAddrType_IPv4, pAddr); 1536 1529 break; 1537 1530 … … 1569 1562 } 1570 1563 1571 1572 1573 1564 switch (msg->event_code) 1574 1565 { … … 1608 1599 } 1609 1600 else 1610 { 1611 Log(("vboxNetFltDarwinSysSockUpcall: subclass %u ignored\n", 1612 (unsigned)msg->kev_subclass)); 1613 } 1601 Log(("vboxNetFltDarwinSysSockUpcall: subclass %u ignored\n", (unsigned)msg->kev_subclass)); 1614 1602 1615 1603 mbuf_freem(m);
Note:
See TracChangeset
for help on using the changeset viewer.