Signed-off-by: Roman Mashak <m...@mojatatu.com>
---
 net/sched/act_police.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/net/sched/act_police.c b/net/sched/act_police.c
index 51fe4fe..d4b4b15 100644
--- a/net/sched/act_police.c
+++ b/net/sched/act_police.c
@@ -314,6 +314,13 @@ static int tcf_police_search(struct net *net, struct 
tc_action **a, u32 index,
        return tcf_idr_search(tn, a, index);
 }
 
+static size_t tcf_police_get_fill_size(const struct tc_action *act)
+{
+       return nla_total_size(sizeof(struct tc_police)) /* TCA_POLICE_TBF */
+               + nla_total_size(sizeof(u32)) /* TCA_POLICE_RESULT */
+               + nla_total_size(sizeof(u32)); /* TCA_POLICE_AVRATE */
+}
+
 MODULE_AUTHOR("Alexey Kuznetsov");
 MODULE_DESCRIPTION("Policing actions");
 MODULE_LICENSE("GPL");
@@ -327,6 +334,7 @@ static struct tc_action_ops act_police_ops = {
        .init           =       tcf_act_police_init,
        .walk           =       tcf_act_police_walker,
        .lookup         =       tcf_police_search,
+       .get_fill_size  =       tcf_police_get_fill_size,
        .size           =       sizeof(struct tcf_police),
 };
 
-- 
2.7.4

Reply via email to