diff options
Diffstat (limited to 'net/decnet')
-rw-r--r-- | net/decnet/dn_dev.c | 3 | ||||
-rw-r--r-- | net/decnet/dn_fib.c | 3 | ||||
-rw-r--r-- | net/decnet/dn_route.c | 8 | ||||
-rw-r--r-- | net/decnet/dn_table.c | 7 |
4 files changed, 12 insertions, 9 deletions
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c index 4400da7739da..b2c26b081134 100644 --- a/net/decnet/dn_dev.c +++ b/net/decnet/dn_dev.c | |||
@@ -702,7 +702,8 @@ static int dn_nl_fill_ifaddr(struct sk_buff *skb, struct dn_ifaddr *ifa, | |||
702 | nla_put_string(skb, IFA_LABEL, ifa->ifa_label)) || | 702 | nla_put_string(skb, IFA_LABEL, ifa->ifa_label)) || |
703 | nla_put_u32(skb, IFA_FLAGS, ifa_flags)) | 703 | nla_put_u32(skb, IFA_FLAGS, ifa_flags)) |
704 | goto nla_put_failure; | 704 | goto nla_put_failure; |
705 | return nlmsg_end(skb, nlh); | 705 | nlmsg_end(skb, nlh); |
706 | return 0; | ||
706 | 707 | ||
707 | nla_put_failure: | 708 | nla_put_failure: |
708 | nlmsg_cancel(skb, nlh); | 709 | nlmsg_cancel(skb, nlh); |
diff --git a/net/decnet/dn_fib.c b/net/decnet/dn_fib.c index d332aefb0846..df4803437888 100644 --- a/net/decnet/dn_fib.c +++ b/net/decnet/dn_fib.c | |||
@@ -298,7 +298,8 @@ struct dn_fib_info *dn_fib_create_info(const struct rtmsg *r, struct nlattr *att | |||
298 | int type = nla_type(attr); | 298 | int type = nla_type(attr); |
299 | 299 | ||
300 | if (type) { | 300 | if (type) { |
301 | if (type > RTAX_MAX || nla_len(attr) < 4) | 301 | if (type > RTAX_MAX || type == RTAX_CC_ALGO || |
302 | nla_len(attr) < 4) | ||
302 | goto err_inval; | 303 | goto err_inval; |
303 | 304 | ||
304 | fi->fib_metrics[type-1] = nla_get_u32(attr); | 305 | fi->fib_metrics[type-1] = nla_get_u32(attr); |
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c index daccc4a36d80..1d7c1256e845 100644 --- a/net/decnet/dn_route.c +++ b/net/decnet/dn_route.c | |||
@@ -1616,7 +1616,8 @@ static int dn_rt_fill_info(struct sk_buff *skb, u32 portid, u32 seq, | |||
1616 | nla_put_u32(skb, RTA_IIF, rt->fld.flowidn_iif) < 0) | 1616 | nla_put_u32(skb, RTA_IIF, rt->fld.flowidn_iif) < 0) |
1617 | goto errout; | 1617 | goto errout; |
1618 | 1618 | ||
1619 | return nlmsg_end(skb, nlh); | 1619 | nlmsg_end(skb, nlh); |
1620 | return 0; | ||
1620 | 1621 | ||
1621 | errout: | 1622 | errout: |
1622 | nlmsg_cancel(skb, nlh); | 1623 | nlmsg_cancel(skb, nlh); |
@@ -1709,9 +1710,6 @@ static int dn_cache_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh) | |||
1709 | rt->rt_flags |= RTCF_NOTIFY; | 1710 | rt->rt_flags |= RTCF_NOTIFY; |
1710 | 1711 | ||
1711 | err = dn_rt_fill_info(skb, NETLINK_CB(in_skb).portid, nlh->nlmsg_seq, RTM_NEWROUTE, 0, 0); | 1712 | err = dn_rt_fill_info(skb, NETLINK_CB(in_skb).portid, nlh->nlmsg_seq, RTM_NEWROUTE, 0, 0); |
1712 | |||
1713 | if (err == 0) | ||
1714 | goto out_free; | ||
1715 | if (err < 0) { | 1713 | if (err < 0) { |
1716 | err = -EMSGSIZE; | 1714 | err = -EMSGSIZE; |
1717 | goto out_free; | 1715 | goto out_free; |
@@ -1762,7 +1760,7 @@ int dn_cache_dump(struct sk_buff *skb, struct netlink_callback *cb) | |||
1762 | skb_dst_set(skb, dst_clone(&rt->dst)); | 1760 | skb_dst_set(skb, dst_clone(&rt->dst)); |
1763 | if (dn_rt_fill_info(skb, NETLINK_CB(cb->skb).portid, | 1761 | if (dn_rt_fill_info(skb, NETLINK_CB(cb->skb).portid, |
1764 | cb->nlh->nlmsg_seq, RTM_NEWROUTE, | 1762 | cb->nlh->nlmsg_seq, RTM_NEWROUTE, |
1765 | 1, NLM_F_MULTI) <= 0) { | 1763 | 1, NLM_F_MULTI) < 0) { |
1766 | skb_dst_drop(skb); | 1764 | skb_dst_drop(skb); |
1767 | rcu_read_unlock_bh(); | 1765 | rcu_read_unlock_bh(); |
1768 | goto done; | 1766 | goto done; |
diff --git a/net/decnet/dn_table.c b/net/decnet/dn_table.c index 86e3807052e9..1540b506e3e0 100644 --- a/net/decnet/dn_table.c +++ b/net/decnet/dn_table.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/route.h> /* RTF_xxx */ | 29 | #include <linux/route.h> /* RTF_xxx */ |
30 | #include <net/neighbour.h> | 30 | #include <net/neighbour.h> |
31 | #include <net/netlink.h> | 31 | #include <net/netlink.h> |
32 | #include <net/tcp.h> | ||
32 | #include <net/dst.h> | 33 | #include <net/dst.h> |
33 | #include <net/flow.h> | 34 | #include <net/flow.h> |
34 | #include <net/fib_rules.h> | 35 | #include <net/fib_rules.h> |
@@ -273,7 +274,8 @@ static inline size_t dn_fib_nlmsg_size(struct dn_fib_info *fi) | |||
273 | size_t payload = NLMSG_ALIGN(sizeof(struct rtmsg)) | 274 | size_t payload = NLMSG_ALIGN(sizeof(struct rtmsg)) |
274 | + nla_total_size(4) /* RTA_TABLE */ | 275 | + nla_total_size(4) /* RTA_TABLE */ |
275 | + nla_total_size(2) /* RTA_DST */ | 276 | + nla_total_size(2) /* RTA_DST */ |
276 | + nla_total_size(4); /* RTA_PRIORITY */ | 277 | + nla_total_size(4) /* RTA_PRIORITY */ |
278 | + nla_total_size(TCP_CA_NAME_MAX); /* RTAX_CC_ALGO */ | ||
277 | 279 | ||
278 | /* space for nested metrics */ | 280 | /* space for nested metrics */ |
279 | payload += nla_total_size((RTAX_MAX * nla_total_size(4))); | 281 | payload += nla_total_size((RTAX_MAX * nla_total_size(4))); |
@@ -365,7 +367,8 @@ static int dn_fib_dump_info(struct sk_buff *skb, u32 portid, u32 seq, int event, | |||
365 | nla_nest_end(skb, mp_head); | 367 | nla_nest_end(skb, mp_head); |
366 | } | 368 | } |
367 | 369 | ||
368 | return nlmsg_end(skb, nlh); | 370 | nlmsg_end(skb, nlh); |
371 | return 0; | ||
369 | 372 | ||
370 | errout: | 373 | errout: |
371 | nlmsg_cancel(skb, nlh); | 374 | nlmsg_cancel(skb, nlh); |