diff options
Diffstat (limited to 'net/sched/cls_api.c')
-rw-r--r-- | net/sched/cls_api.c | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index 2c2aac4ac721..dc10525e90e7 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c | |||
@@ -1893,6 +1893,7 @@ static int tfilter_notify(struct net *net, struct sk_buff *oskb, | |||
1893 | { | 1893 | { |
1894 | struct sk_buff *skb; | 1894 | struct sk_buff *skb; |
1895 | u32 portid = oskb ? NETLINK_CB(oskb).portid : 0; | 1895 | u32 portid = oskb ? NETLINK_CB(oskb).portid : 0; |
1896 | int err = 0; | ||
1896 | 1897 | ||
1897 | skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); | 1898 | skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); |
1898 | if (!skb) | 1899 | if (!skb) |
@@ -1906,10 +1907,14 @@ static int tfilter_notify(struct net *net, struct sk_buff *oskb, | |||
1906 | } | 1907 | } |
1907 | 1908 | ||
1908 | if (unicast) | 1909 | if (unicast) |
1909 | return netlink_unicast(net->rtnl, skb, portid, MSG_DONTWAIT); | 1910 | err = netlink_unicast(net->rtnl, skb, portid, MSG_DONTWAIT); |
1911 | else | ||
1912 | err = rtnetlink_send(skb, net, portid, RTNLGRP_TC, | ||
1913 | n->nlmsg_flags & NLM_F_ECHO); | ||
1910 | 1914 | ||
1911 | return rtnetlink_send(skb, net, portid, RTNLGRP_TC, | 1915 | if (err > 0) |
1912 | n->nlmsg_flags & NLM_F_ECHO); | 1916 | err = 0; |
1917 | return err; | ||
1913 | } | 1918 | } |
1914 | 1919 | ||
1915 | static int tfilter_del_notify(struct net *net, struct sk_buff *oskb, | 1920 | static int tfilter_del_notify(struct net *net, struct sk_buff *oskb, |
@@ -1941,12 +1946,15 @@ static int tfilter_del_notify(struct net *net, struct sk_buff *oskb, | |||
1941 | } | 1946 | } |
1942 | 1947 | ||
1943 | if (unicast) | 1948 | if (unicast) |
1944 | return netlink_unicast(net->rtnl, skb, portid, MSG_DONTWAIT); | 1949 | err = netlink_unicast(net->rtnl, skb, portid, MSG_DONTWAIT); |
1945 | 1950 | else | |
1946 | err = rtnetlink_send(skb, net, portid, RTNLGRP_TC, | 1951 | err = rtnetlink_send(skb, net, portid, RTNLGRP_TC, |
1947 | n->nlmsg_flags & NLM_F_ECHO); | 1952 | n->nlmsg_flags & NLM_F_ECHO); |
1948 | if (err < 0) | 1953 | if (err < 0) |
1949 | NL_SET_ERR_MSG(extack, "Failed to send filter delete notification"); | 1954 | NL_SET_ERR_MSG(extack, "Failed to send filter delete notification"); |
1955 | |||
1956 | if (err > 0) | ||
1957 | err = 0; | ||
1950 | return err; | 1958 | return err; |
1951 | } | 1959 | } |
1952 | 1960 | ||
@@ -2688,6 +2696,7 @@ static int tc_chain_notify(struct tcf_chain *chain, struct sk_buff *oskb, | |||
2688 | struct tcf_block *block = chain->block; | 2696 | struct tcf_block *block = chain->block; |
2689 | struct net *net = block->net; | 2697 | struct net *net = block->net; |
2690 | struct sk_buff *skb; | 2698 | struct sk_buff *skb; |
2699 | int err = 0; | ||
2691 | 2700 | ||
2692 | skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); | 2701 | skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); |
2693 | if (!skb) | 2702 | if (!skb) |
@@ -2701,9 +2710,14 @@ static int tc_chain_notify(struct tcf_chain *chain, struct sk_buff *oskb, | |||
2701 | } | 2710 | } |
2702 | 2711 | ||
2703 | if (unicast) | 2712 | if (unicast) |
2704 | return netlink_unicast(net->rtnl, skb, portid, MSG_DONTWAIT); | 2713 | err = netlink_unicast(net->rtnl, skb, portid, MSG_DONTWAIT); |
2714 | else | ||
2715 | err = rtnetlink_send(skb, net, portid, RTNLGRP_TC, | ||
2716 | flags & NLM_F_ECHO); | ||
2705 | 2717 | ||
2706 | return rtnetlink_send(skb, net, portid, RTNLGRP_TC, flags & NLM_F_ECHO); | 2718 | if (err > 0) |
2719 | err = 0; | ||
2720 | return err; | ||
2707 | } | 2721 | } |
2708 | 2722 | ||
2709 | static int tc_chain_notify_delete(const struct tcf_proto_ops *tmplt_ops, | 2723 | static int tc_chain_notify_delete(const struct tcf_proto_ops *tmplt_ops, |