Changeset 56280 in vbox for trunk/src/VBox/HostDrivers/VBoxNetFlt/linux
- Timestamp:
- Jun 8, 2015 8:28:26 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 100861
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
r56144 r56280 88 88 #else 89 89 # define VBOX_NETDEV_NAME(dev) ((dev)->reg_state != NETREG_REGISTERED ? "(unregistered net_device)" : (dev)->name) 90 #endif 91 92 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) 93 # define VBOX_IPV4_IS_LOOPBACK(addr) ipv4_is_loopback(addr) 94 # define VBOX_IPV4_IS_LINKLOCAL_169(addr) ipv4_is_linklocal_169(addr) 95 #else 96 # define VBOX_IPV4_IS_LOOPBACK(addr) ((addr & htonl(IN_CLASSA_NET)) == htonl(0x7f000000)) 97 # define VBOX_IPV4_IS_LINKLOCAL_169(addr) ((addr & htonl(IN_CLASSB_NET)) == htonl(0xa9fe0000)) 90 98 #endif 91 99 … … 1897 1905 { 1898 1906 for_ifa(in_dev) { 1899 if ( IN_LOOPBACK(ntohl(ifa->ifa_address)))1907 if (VBOX_IPV4_IS_LOOPBACK(ifa->ifa_address)) 1900 1908 return NOTIFY_OK; 1909 1910 if ( dev != pThis->u.s.pDev 1911 && VBOX_IPV4_IS_LINKLOCAL_169(ifa->ifa_address)) 1912 continue; 1901 1913 1902 1914 Log(("%s: %s: IPv4 addr %RTnaipv4 mask %RTnaipv4\n", … … 1945 1957 { 1946 1958 PVBOXNETFLTINS pThis = RT_FROM_MEMBER(self, VBOXNETFLTINS, u.s.NotifierIPv4); 1947 struct net_device *pDev ;1959 struct net_device *pDev, *pEventDev; 1948 1960 struct in_ifaddr *ifa = (struct in_ifaddr *)ptr; 1961 bool fMyDev; 1949 1962 int rc = NOTIFY_OK; 1950 1963 1951 1964 pDev = vboxNetFltLinuxRetainNetDev(pThis); 1952 Log(("VBoxNetFlt: %s: IPv4 event %s(0x%lx): addr %RTnaipv4 mask %RTnaipv4\n", 1965 pEventDev = ifa->ifa_dev->dev; 1966 fMyDev = (pDev == pEventDev); 1967 Log(("VBoxNetFlt: %s: IPv4 event %s(0x%lx) %s: addr %RTnaipv4 mask %RTnaipv4\n", 1953 1968 pDev ? VBOX_NETDEV_NAME(pDev) : "<???>", 1954 1969 vboxNetFltLinuxGetNetDevEventName(ulEventType), ulEventType, 1970 pEventDev ? VBOX_NETDEV_NAME(pEventDev) : "<???>", 1955 1971 ifa->ifa_address, ifa->ifa_mask)); 1956 1972 1957 1973 if (pDev != NULL) 1958 1974 vboxNetFltLinuxReleaseNetDev(pThis, pDev); 1975 1976 if (VBOX_IPV4_IS_LOOPBACK(ifa->ifa_address)) 1977 return NOTIFY_OK; 1978 1979 if ( !fMyDev 1980 && VBOX_IPV4_IS_LINKLOCAL_169(ifa->ifa_address)) 1981 return NOTIFY_OK; 1959 1982 1960 1983 if (pThis->pSwitchPort->pfnNotifyHostAddress) … … 1979 2002 { 1980 2003 PVBOXNETFLTINS pThis = RT_FROM_MEMBER(self, VBOXNETFLTINS, u.s.NotifierIPv6); 1981 struct net_device *pDev ;2004 struct net_device *pDev, *pEventDev; 1982 2005 struct inet6_ifaddr *ifa = (struct inet6_ifaddr *)ptr; 2006 bool fMyDev; 1983 2007 int rc = NOTIFY_OK; 1984 2008 1985 2009 pDev = vboxNetFltLinuxRetainNetDev(pThis); 1986 Log(("VBoxNetFlt: %s: IPv6 event %s(0x%lx): %RTnaipv6\n", 2010 pEventDev = ifa->idev->dev; 2011 fMyDev = (pDev == pEventDev); 2012 Log(("VBoxNetFlt: %s: IPv6 event %s(0x%lx) %s: %RTnaipv6\n", 1987 2013 pDev ? VBOX_NETDEV_NAME(pDev) : "<???>", 1988 2014 vboxNetFltLinuxGetNetDevEventName(ulEventType), ulEventType, 2015 pEventDev ? VBOX_NETDEV_NAME(pEventDev) : "<???>", 1989 2016 &ifa->addr)); 1990 2017 1991 2018 if (pDev != NULL) 1992 2019 vboxNetFltLinuxReleaseNetDev(pThis, pDev); 2020 2021 if ( !fMyDev 2022 && ipv6_addr_src_scope(&ifa->addr) <= IPV6_ADDR_SCOPE_LINKLOCAL) 2023 return NOTIFY_OK; 1993 2024 1994 2025 if (pThis->pSwitchPort->pfnNotifyHostAddress)
Note:
See TracChangeset
for help on using the changeset viewer.