ethtool: Fix speed in 593022fa377d40d9a645919759b04c53cf4eace8
authorSusant Sahani <susant@redhat.com>
Mon, 26 Jun 2017 13:07:38 +0000 (18:37 +0530)
committerSusant Sahani <susant@redhat.com>
Mon, 26 Jun 2017 13:07:38 +0000 (18:37 +0530)
We should use the DIV_ROUND_UP

src/udev/net/ethtool-util.c

index 19f5f04..201fc23 100644 (file)
@@ -527,7 +527,7 @@ int ethtool_set_glinksettings(int *fd, const char *ifname, struct link_config *l
         }
 
         if (link->speed)
-                u->base.speed = link->speed;
+                u->base.speed = DIV_ROUND_UP(link->speed, 1000000);
 
         if (link->duplex != _DUP_INVALID)
                 u->base.duplex = link->duplex;