diff options
author | Thomas Haller <thaller@redhat.com> | 2022-03-15 10:15:08 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2022-03-15 10:22:37 (GMT) |
commit | c385c84a0b2121f891fcebb5e947150a9a8002f1 (patch) | |
tree | d315f74e6264516637df6d0d4c19ad74677799ea /lib/route | |
parent | 79217d8a23c3b526e1624efb32ba3376fa85e458 (diff) | |
download | libnl-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.c | 12 |
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; |