diff options
Diffstat (limited to 'net/core/rtnetlink.c')
-rw-r--r-- | net/core/rtnetlink.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index b376410ff259..23854b51a259 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -496,8 +496,10 @@ static int rtnl_link_fill(struct sk_buff *skb, const struct net_device *dev) | |||
496 | } | 496 | } |
497 | if (ops->fill_info) { | 497 | if (ops->fill_info) { |
498 | data = nla_nest_start(skb, IFLA_INFO_DATA); | 498 | data = nla_nest_start(skb, IFLA_INFO_DATA); |
499 | if (data == NULL) | 499 | if (data == NULL) { |
500 | err = -EMSGSIZE; | ||
500 | goto err_cancel_link; | 501 | goto err_cancel_link; |
502 | } | ||
501 | err = ops->fill_info(skb, dev); | 503 | err = ops->fill_info(skb, dev); |
502 | if (err < 0) | 504 | if (err < 0) |
503 | goto err_cancel_data; | 505 | goto err_cancel_data; |
@@ -979,6 +981,7 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev, | |||
979 | * report anything. | 981 | * report anything. |
980 | */ | 982 | */ |
981 | ivi.spoofchk = -1; | 983 | ivi.spoofchk = -1; |
984 | memset(ivi.mac, 0, sizeof(ivi.mac)); | ||
982 | if (dev->netdev_ops->ndo_get_vf_config(dev, i, &ivi)) | 985 | if (dev->netdev_ops->ndo_get_vf_config(dev, i, &ivi)) |
983 | break; | 986 | break; |
984 | vf_mac.vf = | 987 | vf_mac.vf = |
@@ -1069,7 +1072,7 @@ static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb) | |||
1069 | rcu_read_lock(); | 1072 | rcu_read_lock(); |
1070 | cb->seq = net->dev_base_seq; | 1073 | cb->seq = net->dev_base_seq; |
1071 | 1074 | ||
1072 | if (nlmsg_parse(cb->nlh, sizeof(struct rtgenmsg), tb, IFLA_MAX, | 1075 | if (nlmsg_parse(cb->nlh, sizeof(struct ifinfomsg), tb, IFLA_MAX, |
1073 | ifla_policy) >= 0) { | 1076 | ifla_policy) >= 0) { |
1074 | 1077 | ||
1075 | if (tb[IFLA_EXT_MASK]) | 1078 | if (tb[IFLA_EXT_MASK]) |
@@ -1919,7 +1922,7 @@ static u16 rtnl_calcit(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
1919 | u32 ext_filter_mask = 0; | 1922 | u32 ext_filter_mask = 0; |
1920 | u16 min_ifinfo_dump_size = 0; | 1923 | u16 min_ifinfo_dump_size = 0; |
1921 | 1924 | ||
1922 | if (nlmsg_parse(nlh, sizeof(struct rtgenmsg), tb, IFLA_MAX, | 1925 | if (nlmsg_parse(nlh, sizeof(struct ifinfomsg), tb, IFLA_MAX, |
1923 | ifla_policy) >= 0) { | 1926 | ifla_policy) >= 0) { |
1924 | if (tb[IFLA_EXT_MASK]) | 1927 | if (tb[IFLA_EXT_MASK]) |
1925 | ext_filter_mask = nla_get_u32(tb[IFLA_EXT_MASK]); | 1928 | ext_filter_mask = nla_get_u32(tb[IFLA_EXT_MASK]); |
@@ -2620,7 +2623,7 @@ static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
2620 | struct rtattr *attr = (void *)nlh + NLMSG_ALIGN(min_len); | 2623 | struct rtattr *attr = (void *)nlh + NLMSG_ALIGN(min_len); |
2621 | 2624 | ||
2622 | while (RTA_OK(attr, attrlen)) { | 2625 | while (RTA_OK(attr, attrlen)) { |
2623 | unsigned int flavor = attr->rta_type; | 2626 | unsigned int flavor = attr->rta_type & NLA_TYPE_MASK; |
2624 | if (flavor) { | 2627 | if (flavor) { |
2625 | if (flavor > rta_max[sz_idx]) | 2628 | if (flavor > rta_max[sz_idx]) |
2626 | return -EINVAL; | 2629 | return -EINVAL; |