]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
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 19f5f049e431db7a127f7100a84c16e0452ff2dc..201fc2343726f3ffdbf3d132a2ab7d351fe09951 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;