Changeset 85344 in vbox for trunk/src/VBox/HostDrivers
- Timestamp:
- Jul 14, 2020 6:46:00 PM (5 years ago)
- Location:
- trunk/src/VBox/HostDrivers
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetFlt/darwin/VBoxNetFlt-darwin.cpp
r85124 r85344 59 59 #include <sys/sockio.h> 60 60 #include <sys/kern_event.h> 61 #include <net/kpi_interface.h> 61 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 101500 /* The 10.15 SDK has a slightly butchered API deprecation attempt. */ 62 # pragma clang diagnostic push 63 # pragma clang diagnostic ignored "-Wmacro-redefined" /* Each header redefines __NKE_API_DEPRECATED. */ 64 # pragma clang diagnostic ignored "-Wmissing-declarations" /* Misplaced __NKE_API_DEPRECATED; in kpi_mbuf.h. */ 65 # include <sys/kpi_socket.h> 66 # include <net/kpi_interface.h> 67 # include <sys/kpi_mbuf.h> 68 # include <net/kpi_interfacefilter.h> 69 # pragma clang diagnostic pop 70 #else /* < 10.15*/ 71 # include <sys/kpi_socket.h> 72 # include <net/kpi_interface.h> 62 73 RT_C_DECLS_BEGIN /* Buggy 10.4 headers, fixed in 10.5. */ 63 # include <sys/kpi_mbuf.h>64 # include <net/kpi_interfacefilter.h>74 # include <sys/kpi_mbuf.h> 75 # include <net/kpi_interfacefilter.h> 65 76 RT_C_DECLS_END 66 67 #include <sys/kpi_socket.h> 77 #endif /* < 10.15*/ 78 79 68 80 #include <net/if.h> 69 81 #include <net/if_var.h> … … 1375 1387 if (pThis->u.s.pSysSock != NULL) 1376 1388 { 1389 RT_GCC_NO_WARN_DEPRECATED_BEGIN 1390 1377 1391 sock_close(pThis->u.s.pSysSock); 1378 1392 pThis->u.s.pSysSock = NULL; 1393 1394 RT_GCC_NO_WARN_DEPRECATED_END 1379 1395 } 1380 1396 … … 1406 1422 errno_t error; 1407 1423 1424 /** @todo Figure out how to replace the socket stuff we use to detect 1425 * addresses here as 10.5 deprecates it. */ 1426 RT_GCC_NO_WARN_DEPRECATED_BEGIN 1427 1408 1428 /** @todo reorg code to not have numerous returns with duplicate code... */ 1429 /** @todo reorg code to not have numerous returns with duplicate code... */ 1430 /** @todo reorg code to not have numerous returns with duplicate code... */ 1431 /** @todo reorg code to not have numerous returns with duplicate code... */ 1432 /** @todo reorg code to not have numerous returns with duplicate code... */ 1433 /** @todo reorg code to not have numerous returns with duplicate code... */ 1434 /** @todo reorg code to not have numerous returns with duplicate code... */ 1435 /** @todo reorg code to not have numerous returns with duplicate code... */ 1436 /** @todo reorg code to not have numerous returns with duplicate code... */ 1437 1409 1438 error = sock_socket(PF_SYSTEM, SOCK_RAW, SYSPROTO_EVENT, 1410 1439 vboxNetFltDarwinSysSockUpcall, pThis, … … 1448 1477 return rc; 1449 1478 } 1479 RT_GCC_NO_WARN_DEPRECATED_END 1450 1480 1451 1481 ifnet_t pIfNet = pThis->u.s.pIfNet; /* already retained */ … … 1527 1557 if (RT_UNLIKELY(pSysSock != pThis->u.s.pSysSock)) 1528 1558 { 1529 Log(("vboxNetFltDarwinSysSockUpcall: %p != %p?\n", 1530 pSysSock, pThis->u.s.pSysSock)); 1559 Log(("vboxNetFltDarwinSysSockUpcall: %p != %p?\n", pSysSock, pThis->u.s.pSysSock)); 1531 1560 return; 1532 1561 } … … 1541 1570 size_t len = sizeof(struct kern_event_msg) - sizeof(u_int32_t) + sizeof(struct kev_in6_data); 1542 1571 1572 RT_GCC_NO_WARN_DEPRECATED_BEGIN 1543 1573 error = sock_receivembuf(pSysSock, NULL, &m, 0, &len); 1574 RT_GCC_NO_WARN_DEPRECATED_END 1544 1575 if (error != 0) 1545 1576 { … … 1566 1597 if (len - (sizeof(struct kern_event_msg) - sizeof(u_int32_t)) < sizeof(struct kev_in_data)) 1567 1598 { 1568 Log(("vboxNetFltDarwinSysSockUpcall: %u bytes is too short for KEV_INET_SUBCLASS\n", 1569 (unsigned int)len)); 1599 Log(("vboxNetFltDarwinSysSockUpcall: %u bytes is too short for KEV_INET_SUBCLASS\n", (unsigned int)len)); 1570 1600 mbuf_freem(m); 1571 1601 return; … … 1613 1643 { 1614 1644 Log(("vboxNetFltDarwinSysSockUpcall: %u bytes is too short for KEV_INET6_SUBCLASS\n", 1615 1645 (unsigned int)len)); 1616 1646 mbuf_freem(m); 1617 1647 return; … … 1653 1683 1654 1684 kev_inet6_new: 1655 pThis->pSwitchPort->pfnNotifyHostAddress(pThis->pSwitchPort, 1656 /* :fAdded */ true, kIntNetAddrType_IPv6, pAddr); 1685 pThis->pSwitchPort->pfnNotifyHostAddress(pThis->pSwitchPort, true /*fAdded*/, kIntNetAddrType_IPv6, pAddr); 1657 1686 break; 1658 1687 … … 1661 1690 IFNAMSIZ, link->if_name, link->if_unit, pAddr)); 1662 1691 1663 pThis->pSwitchPort->pfnNotifyHostAddress(pThis->pSwitchPort, 1664 /* :fAdded */ false, kIntNetAddrType_IPv6, pAddr); 1692 pThis->pSwitchPort->pfnNotifyHostAddress(pThis->pSwitchPort, false /*fAdded*/, kIntNetAddrType_IPv6, pAddr); 1665 1693 break; 1666 1694 -
trunk/src/VBox/HostDrivers/darwin/VBoxNetSend.h
r82968 r85344 40 40 41 41 # include <sys/socket.h> 42 # include <net/kpi_interface.h> 42 # if MAC_OS_X_VERSION_MIN_REQUIRED >= 101500 /* The 10.15 SDK has a slightly butchered API deprecation attempt. */ 43 # pragma clang diagnostic push 44 # pragma clang diagnostic ignored "-Wmacro-redefined" /* Each header redefines __NKE_API_DEPRECATED. */ 45 # pragma clang diagnostic ignored "-Wmissing-declarations" /* Misplaced __NKE_API_DEPRECATED; in kpi_mbuf.h. */ 46 # include <net/kpi_interface.h> 47 # include <sys/kpi_mbuf.h> 48 # include <net/if.h> 49 # pragma clang diagnostic pop 50 # else /* < 10.15 */ 51 # include <net/kpi_interface.h> 43 52 RT_C_DECLS_BEGIN /* Buggy 10.4 headers, fixed in 10.5. */ 44 # include <sys/kpi_mbuf.h>53 # include <sys/kpi_mbuf.h> 45 54 RT_C_DECLS_END 46 # include <net/if.h> 55 # include <net/if.h> 56 # endif /* < 10.15 */ 57 47 58 48 59 RT_C_DECLS_BEGIN
Note:
See TracChangeset
for help on using the changeset viewer.