diff options
author | Ben Pfaff <blp@nicira.com> | 2013-09-04 13:37:56 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2013-09-04 13:38:50 -0700 |
commit | 2ea2648141fba06cd6f81c00fc831de6afcc20e9 (patch) | |
tree | 7d21c70646f6542e26ad3c6575bfbe458ab3053e /ofproto | |
parent | efa36473040f4f00062b282d97f67837f84381a3 (diff) |
ofproto: Convert units correctly in ofport_open().
netdev_features_to_bps() returns a speed in bps, but struct
ofputil_phy_port's curr_speed and max_speed are in kbps, so a conversion
is necessary. This commit fixes the problem.
Reported-by: Benjamin Lunsky <benjamin.lunsky@netronome.com>
Tested-by: Benjamin Lunsky <benjamin.lunsky@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'ofproto')
-rw-r--r-- | ofproto/ofproto.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index ca84d085..448cf1d0 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -1688,8 +1688,8 @@ ofport_open(struct ofproto *ofproto, pp->state = netdev_get_carrier(netdev) ? 0 : OFPUTIL_PS_LINK_DOWN; netdev_get_features(netdev, &pp->curr, &pp->advertised, &pp->supported, &pp->peer); - pp->curr_speed = netdev_features_to_bps(pp->curr, 0); - pp->max_speed = netdev_features_to_bps(pp->supported, 0); + pp->curr_speed = netdev_features_to_bps(pp->curr, 0) / 1000; + pp->max_speed = netdev_features_to_bps(pp->supported, 0) / 1000; return netdev; } |