diff options
| -rw-r--r-- | net/sched/cls_api.c | 32 | ||||
| -rw-r--r-- | net/sched/sch_api.c | 15 |
2 files changed, 34 insertions, 13 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, |
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 352b46f98440..fb8f138b9776 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c | |||
| @@ -1824,6 +1824,7 @@ static int tclass_notify(struct net *net, struct sk_buff *oskb, | |||
| 1824 | { | 1824 | { |
| 1825 | struct sk_buff *skb; | 1825 | struct sk_buff *skb; |
| 1826 | u32 portid = oskb ? NETLINK_CB(oskb).portid : 0; | 1826 | u32 portid = oskb ? NETLINK_CB(oskb).portid : 0; |
| 1827 | int err = 0; | ||
| 1827 | 1828 | ||
| 1828 | skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); | 1829 | skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); |
| 1829 | if (!skb) | 1830 | if (!skb) |
| @@ -1834,8 +1835,11 @@ static int tclass_notify(struct net *net, struct sk_buff *oskb, | |||
| 1834 | return -EINVAL; | 1835 | return -EINVAL; |
| 1835 | } | 1836 | } |
| 1836 | 1837 | ||
| 1837 | return rtnetlink_send(skb, net, portid, RTNLGRP_TC, | 1838 | err = rtnetlink_send(skb, net, portid, RTNLGRP_TC, |
| 1838 | n->nlmsg_flags & NLM_F_ECHO); | 1839 | n->nlmsg_flags & NLM_F_ECHO); |
| 1840 | if (err > 0) | ||
| 1841 | err = 0; | ||
| 1842 | return err; | ||
| 1839 | } | 1843 | } |
| 1840 | 1844 | ||
| 1841 | static int tclass_del_notify(struct net *net, | 1845 | static int tclass_del_notify(struct net *net, |
| @@ -1866,8 +1870,11 @@ static int tclass_del_notify(struct net *net, | |||
| 1866 | return err; | 1870 | return err; |
| 1867 | } | 1871 | } |
| 1868 | 1872 | ||
| 1869 | return rtnetlink_send(skb, net, portid, RTNLGRP_TC, | 1873 | err = rtnetlink_send(skb, net, portid, RTNLGRP_TC, |
| 1870 | n->nlmsg_flags & NLM_F_ECHO); | 1874 | n->nlmsg_flags & NLM_F_ECHO); |
| 1875 | if (err > 0) | ||
| 1876 | err = 0; | ||
| 1877 | return err; | ||
| 1871 | } | 1878 | } |
| 1872 | 1879 | ||
| 1873 | #ifdef CONFIG_NET_CLS | 1880 | #ifdef CONFIG_NET_CLS |
