Commit 58414d32 authored by Nicolas Dichtel's avatar Nicolas Dichtel Committed by David S. Miller

rtnl: use the new API to align IFLA_STATS*

Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 089bf1a6
...@@ -1051,14 +1051,9 @@ static noinline_for_stack int rtnl_fill_stats(struct sk_buff *skb, ...@@ -1051,14 +1051,9 @@ static noinline_for_stack int rtnl_fill_stats(struct sk_buff *skb,
{ {
struct rtnl_link_stats64 *sp; struct rtnl_link_stats64 *sp;
struct nlattr *attr; struct nlattr *attr;
int err;
err = nla_align_64bit(skb, IFLA_PAD);
if (err)
return err;
attr = nla_reserve(skb, IFLA_STATS64, attr = nla_reserve_64bit(skb, IFLA_STATS64,
sizeof(struct rtnl_link_stats64)); sizeof(struct rtnl_link_stats64), IFLA_PAD);
if (!attr) if (!attr)
return -EMSGSIZE; return -EMSGSIZE;
...@@ -3469,17 +3464,10 @@ static int rtnl_fill_statsinfo(struct sk_buff *skb, struct net_device *dev, ...@@ -3469,17 +3464,10 @@ static int rtnl_fill_statsinfo(struct sk_buff *skb, struct net_device *dev,
if (filter_mask & IFLA_STATS_FILTER_BIT(IFLA_STATS_LINK_64)) { if (filter_mask & IFLA_STATS_FILTER_BIT(IFLA_STATS_LINK_64)) {
struct rtnl_link_stats64 *sp; struct rtnl_link_stats64 *sp;
int err;
/* if necessary, add a zero length NOP attribute so that
* IFLA_STATS_LINK_64 will be 64-bit aligned
*/
err = nla_align_64bit(skb, IFLA_STATS_UNSPEC);
if (err)
goto nla_put_failure;
attr = nla_reserve(skb, IFLA_STATS_LINK_64, attr = nla_reserve_64bit(skb, IFLA_STATS_LINK_64,
sizeof(struct rtnl_link_stats64)); sizeof(struct rtnl_link_stats64),
IFLA_STATS_UNSPEC);
if (!attr) if (!attr)
goto nla_put_failure; goto nla_put_failure;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment