Fix gcc 4.7 compilation problem for shill.
TEST=built using gcc 4.7
BUG=None
Change-Id: Ifdc9b192b71e3606f16b3dc7e4ef1792134931e1
Reviewed-on: https://gerrit.chromium.org/gerrit/27829
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Han Shen <shenhan@chromium.org>
Commit-Ready: Han Shen <shenhan@chromium.org>
diff --git a/rtnl_message.cc b/rtnl_message.cc
index 0404fb4..6d57048 100644
--- a/rtnl_message.cc
+++ b/rtnl_message.cc
@@ -253,7 +253,7 @@
size_t len = RTA_LENGTH(attr->second.GetLength());
hdr.hdr.nlmsg_len = NLMSG_ALIGN(hdr.hdr.nlmsg_len) + RTA_ALIGN(len);
- struct rtattr rt_attr = { len, attr->first };
+ struct rtattr rt_attr = { static_cast<unsigned short>(len), attr->first };
ByteString attr_header(reinterpret_cast<unsigned char *>(&rt_attr),
sizeof(rt_attr));
attr_header.Resize(RTA_ALIGN(attr_header.GetLength()));