VirtualBox

Changeset 57120 in vbox for trunk/src/VBox/HostDrivers


Ignore:
Timestamp:
Jul 29, 2015 8:26:59 PM (9 years ago)
Author:
vboxsync
Message:

VBoxNetFlt/linux: Don't attach to an interface from a different
network namespace. Helps peaceful coexistence with lxc/docker.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c

    r57118 r57120  
    18491849         vboxNetFltLinuxGetNetDevEventName(ulEventType), ulEventType, pDev->name, pDev, pThis, pMyDev));
    18501850
    1851     if (    ulEventType == NETDEV_REGISTER
    1852         && !strcmp(pDev->name, pThis->szName))
    1853     {
    1854         vboxNetFltLinuxAttachToInterface(pThis, pDev);
     1851    if (ulEventType == NETDEV_REGISTER)
     1852    {
     1853#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) /* cgroups/namespaces introduced */
     1854# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
     1855#  define VBOX_DEV_NET(dev)             dev_net(dev)
     1856#  define VBOX_NET_EQ(n1, n2)           net_eq((n1), (n2))
     1857# else
     1858#  define VBOX_DEV_NET(dev)             ((dev)->nd_net)
     1859#  define VBOX_NET_EQ(n1, n2)           ((n1) == (n2))
     1860# endif
     1861        struct net *pMyNet = current->nsproxy->net_ns;
     1862        struct net *pDevNet = VBOX_DEV_NET(pDev);
     1863
     1864        if (VBOX_NET_EQ(pDevNet, pMyNet))
     1865#endif  /* namespaces */
     1866        {
     1867            if (strcmp(pDev->name, pThis->szName) == 0)
     1868            {
     1869                vboxNetFltLinuxAttachToInterface(pThis, pDev);
     1870            }
     1871        }
    18551872    }
    18561873    else
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette