summaryrefslogtreecommitdiffstats
path: root/lib/route
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2022-03-15 10:15:08 (GMT)
committerThomas Haller <thaller@redhat.com>2022-03-15 10:22:37 (GMT)
commitc385c84a0b2121f891fcebb5e947150a9a8002f1 (patch)
treed315f74e6264516637df6d0d4c19ad74677799ea /lib/route
parent79217d8a23c3b526e1624efb32ba3376fa85e458 (diff)
downloadlibnl-c385c84a0b2121f891fcebb5e947150a9a8002f1.zip
libnl-c385c84a0b2121f891fcebb5e947150a9a8002f1.tar.gz
libnl-c385c84a0b2121f891fcebb5e947150a9a8002f1.tar.bz2
route/cls: no need to copy simple fields in flower_clone()
nl_object_clone() already does a shallow clone using memcpy(). So all simple fields are already initialized. We only need the oo_clone() implementation to get the deep-copy right.
Diffstat (limited to 'lib/route')
-rw-r--r--lib/route/cls/flower.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/lib/route/cls/flower.c b/lib/route/cls/flower.c
index a47b704..c58a9d5 100644
--- a/lib/route/cls/flower.c
+++ b/lib/route/cls/flower.c
@@ -188,18 +188,6 @@ static int flower_clone(void *_dst, void *_src)
{
struct rtnl_flower *dst = _dst, *src = _src;
- if (src->cf_mask & FLOWER_ATTR_DST_MAC)
- memcpy(dst->cf_dst_mac, src->cf_dst_mac, ETH_ALEN);
-
- if (src->cf_mask & FLOWER_ATTR_DST_MAC_MASK)
- memcpy(dst->cf_dst_mac_mask, src->cf_dst_mac_mask, ETH_ALEN);
-
- if (src->cf_mask & FLOWER_ATTR_SRC_MAC)
- memcpy(dst->cf_src_mac, src->cf_src_mac, ETH_ALEN);
-
- if (src->cf_mask & FLOWER_ATTR_SRC_MAC_MASK)
- memcpy(dst->cf_src_mac_mask, src->cf_src_mac_mask, ETH_ALEN);
-
if (src->cf_act) {
if (!(dst->cf_act = rtnl_act_alloc()))
return -NLE_NOMEM;