]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
net sched filters: pass netlink message flags in event notification
authorRoman Mashak <mrv@mojatatu.com>
Wed, 16 Nov 2016 22:16:10 +0000 (17:16 -0500)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 Nov 2016 18:42:12 +0000 (13:42 -0500)
Userland client should be able to read an event, and reflect it back to
the kernel, therefore it needs to extract complete set of netlink flags.

For example, this will allow "tc monitor" to distinguish Add and Replace
operations.

Signed-off-by: Roman Mashak <mrv@mojatatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_api.c

index 2b2a7974e4bba24a75b60a17b0014376e2e887c9..8e93d4afe5ead0b0a983a1cb29627b517c2c8421 100644 (file)
@@ -112,7 +112,7 @@ static void tfilter_notify_chain(struct net *net, struct sk_buff *oskb,
 
        for (it_chain = chain; (tp = rtnl_dereference(*it_chain)) != NULL;
             it_chain = &tp->next)
-               tfilter_notify(net, oskb, n, tp, 0, event, false);
+               tfilter_notify(net, oskb, n, tp, n->nlmsg_flags, event, false);
 }
 
 /* Select new prio value from the range, managed by kernel. */
@@ -430,7 +430,8 @@ static int tfilter_notify(struct net *net, struct sk_buff *oskb,
        if (!skb)
                return -ENOBUFS;
 
-       if (tcf_fill_node(net, skb, tp, fh, portid, n->nlmsg_seq, 0, event) <= 0) {
+       if (tcf_fill_node(net, skb, tp, fh, portid, n->nlmsg_seq,
+                         n->nlmsg_flags, event) <= 0) {
                kfree_skb(skb);
                return -EINVAL;
        }