diff --git a/libnetwork/drivers/ipvlan/ipvlan_network.go b/libnetwork/drivers/ipvlan/ipvlan_network.go index 60bdb0e875..3609773a90 100644 --- a/libnetwork/drivers/ipvlan/ipvlan_network.go +++ b/libnetwork/drivers/ipvlan/ipvlan_network.go @@ -20,8 +20,8 @@ func (d *driver) CreateNetwork(nid string, option map[string]interface{}, ipV4Da if err != nil { return fmt.Errorf("Failed to check kernel version for %s driver support: %v", ipvlanType, err) } - // ensure Kernel version is greater then v4.0 for ipvlan support - if kv.Kernel < ipvlanKernelVer { + // ensure Kernel version is >= v4.2 for ipvlan support + if kv.Kernel < ipvlanKernelVer || (kv.Kernel == ipvlanKernelVer && kv.Major < ipvlanMajorVer) { return fmt.Errorf("kernel version failed to meet the minimum ipvlan kernel requirement of %d.%d, found %d.%d.%d", ipvlanKernelVer, ipvlanMajorVer, kv.Kernel, kv.Major, kv.Minor) } diff --git a/libnetwork/drivers/ipvlan/ipvlan_setup.go b/libnetwork/drivers/ipvlan/ipvlan_setup.go index d8abf6d96e..68eb3ee6cc 100644 --- a/libnetwork/drivers/ipvlan/ipvlan_setup.go +++ b/libnetwork/drivers/ipvlan/ipvlan_setup.go @@ -15,7 +15,7 @@ import ( const ( dummyPrefix = "di-" // ipvlan prefix for dummy parent interface ipvlanKernelVer = 4 // minimum ipvlan kernel support - ipvlanMajorVer = 0 // minimum ipvlan major kernel support + ipvlanMajorVer = 2 // minimum ipvlan major kernel support ) // createIPVlan Create the ipvlan slave specifying the source name diff --git a/libnetwork/drivers/macvlan/macvlan_network.go b/libnetwork/drivers/macvlan/macvlan_network.go index abaefc3059..c5eb9d8d1b 100644 --- a/libnetwork/drivers/macvlan/macvlan_network.go +++ b/libnetwork/drivers/macvlan/macvlan_network.go @@ -20,7 +20,7 @@ func (d *driver) CreateNetwork(nid string, option map[string]interface{}, ipV4Da if err != nil { return fmt.Errorf("failed to check kernel version for %s driver support: %v", macvlanType, err) } - // ensure Kernel version is greater then v3.9 for macvlan support + // ensure Kernel version is >= v3.9 for macvlan support if kv.Kernel < macvlanKernelVer || (kv.Kernel == macvlanKernelVer && kv.Major < macvlanMajorVer) { return fmt.Errorf("kernel version failed to meet the minimum macvlan kernel requirement of %d.%d, found %d.%d.%d", macvlanKernelVer, macvlanMajorVer, kv.Kernel, kv.Major, kv.Minor)