net: fix printing ethernet addresses

This commit is contained in:
Avi Kivity
2014-09-02 23:32:15 +03:00
parent 1fbe325f63
commit 602eaeded7

View File

@@ -8,8 +8,9 @@ namespace net {
std::ostream& operator<<(std::ostream& os, ethernet_address ea) {
auto& m = ea.mac;
using u = uint32_t;
return fprint(os, "%02x:%02x:%02x:%02x:%02x:%02x",
m[0], m[1], m[2], m[3], m[4], m[5]);
u(m[0]), u(m[1]), u(m[2]), u(m[3]), u(m[4]), u(m[5]));
}
}