Skip to content

Commit 49a90ad

Browse files
committed
route: tc: make sure to copy stats when cloning
1 parent 2e28fad commit 49a90ad

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/route/tc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,12 @@ int rtnl_tc_clone(struct nl_object *dstobj, struct nl_object *srcobj)
843843
dst->tc_subdata = NULL;
844844
dst->tc_link = NULL;
845845
dst->tc_ops = NULL;
846+
memset(dst->tc_stats, 0, sizeof(src->tc_stats));
847+
848+
if (src->ce_mask & TCA_ATTR_STATS) {
849+
memcpy(dst->tc_stats, src->tc_stats, sizeof(src->tc_stats));
850+
dst->ce_mask |= TCA_ATTR_STATS;
851+
}
846852

847853
if (src->tc_link) {
848854
nl_object_get(OBJ_CAST(src->tc_link));

0 commit comments

Comments
 (0)