diff options
Diffstat (limited to 'net/decnet/dn_dev.c')
-rw-r--r-- | net/decnet/dn_dev.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c index 476455fbdb03..01861feb608d 100644 --- a/net/decnet/dn_dev.c +++ b/net/decnet/dn_dev.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/seq_file.h> | 34 | #include <linux/seq_file.h> |
35 | #include <linux/timer.h> | 35 | #include <linux/timer.h> |
36 | #include <linux/string.h> | 36 | #include <linux/string.h> |
37 | #include <linux/if_addr.h> | ||
37 | #include <linux/if_arp.h> | 38 | #include <linux/if_arp.h> |
38 | #include <linux/if_ether.h> | 39 | #include <linux/if_ether.h> |
39 | #include <linux/skbuff.h> | 40 | #include <linux/skbuff.h> |
@@ -45,6 +46,7 @@ | |||
45 | #include <net/neighbour.h> | 46 | #include <net/neighbour.h> |
46 | #include <net/dst.h> | 47 | #include <net/dst.h> |
47 | #include <net/flow.h> | 48 | #include <net/flow.h> |
49 | #include <net/fib_rules.h> | ||
48 | #include <net/dn.h> | 50 | #include <net/dn.h> |
49 | #include <net/dn_dev.h> | 51 | #include <net/dn_dev.h> |
50 | #include <net/dn_route.h> | 52 | #include <net/dn_route.h> |
@@ -744,20 +746,23 @@ rtattr_failure: | |||
744 | static void rtmsg_ifa(int event, struct dn_ifaddr *ifa) | 746 | static void rtmsg_ifa(int event, struct dn_ifaddr *ifa) |
745 | { | 747 | { |
746 | struct sk_buff *skb; | 748 | struct sk_buff *skb; |
747 | int size = NLMSG_SPACE(sizeof(struct ifaddrmsg)+128); | 749 | int payload = sizeof(struct ifaddrmsg) + 128; |
750 | int err = -ENOBUFS; | ||
748 | 751 | ||
749 | skb = alloc_skb(size, GFP_KERNEL); | 752 | skb = alloc_skb(nlmsg_total_size(payload), GFP_KERNEL); |
750 | if (!skb) { | 753 | if (skb == NULL) |
751 | netlink_set_err(rtnl, 0, RTNLGRP_DECnet_IFADDR, ENOBUFS); | 754 | goto errout; |
752 | return; | 755 | |
753 | } | 756 | err = dn_dev_fill_ifaddr(skb, ifa, 0, 0, event, 0); |
754 | if (dn_dev_fill_ifaddr(skb, ifa, 0, 0, event, 0) < 0) { | 757 | if (err < 0) { |
755 | kfree_skb(skb); | 758 | kfree_skb(skb); |
756 | netlink_set_err(rtnl, 0, RTNLGRP_DECnet_IFADDR, EINVAL); | 759 | goto errout; |
757 | return; | ||
758 | } | 760 | } |
759 | NETLINK_CB(skb).dst_group = RTNLGRP_DECnet_IFADDR; | 761 | |
760 | netlink_broadcast(rtnl, skb, 0, RTNLGRP_DECnet_IFADDR, GFP_KERNEL); | 762 | err = rtnl_notify(skb, 0, RTNLGRP_DECnet_IFADDR, NULL, GFP_KERNEL); |
763 | errout: | ||
764 | if (err < 0) | ||
765 | rtnl_set_sk_err(RTNLGRP_DECnet_IFADDR, err); | ||
761 | } | 766 | } |
762 | 767 | ||
763 | static int dn_dev_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb) | 768 | static int dn_dev_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb) |
@@ -1417,8 +1422,6 @@ static struct rtnetlink_link dnet_rtnetlink_table[RTM_NR_MSGTYPES] = | |||
1417 | [RTM_DELROUTE - RTM_BASE] = { .doit = dn_fib_rtm_delroute, }, | 1422 | [RTM_DELROUTE - RTM_BASE] = { .doit = dn_fib_rtm_delroute, }, |
1418 | [RTM_GETROUTE - RTM_BASE] = { .doit = dn_cache_getroute, | 1423 | [RTM_GETROUTE - RTM_BASE] = { .doit = dn_cache_getroute, |
1419 | .dumpit = dn_fib_dump, }, | 1424 | .dumpit = dn_fib_dump, }, |
1420 | [RTM_NEWRULE - RTM_BASE] = { .doit = dn_fib_rtm_newrule, }, | ||
1421 | [RTM_DELRULE - RTM_BASE] = { .doit = dn_fib_rtm_delrule, }, | ||
1422 | [RTM_GETRULE - RTM_BASE] = { .dumpit = dn_fib_dump_rules, }, | 1425 | [RTM_GETRULE - RTM_BASE] = { .dumpit = dn_fib_dump_rules, }, |
1423 | #else | 1426 | #else |
1424 | [RTM_GETROUTE - RTM_BASE] = { .doit = dn_cache_getroute, | 1427 | [RTM_GETROUTE - RTM_BASE] = { .doit = dn_cache_getroute, |