pppoe: fix memcpy out of bounds with gcc-11 on arm
[vpp.git] / src / plugins / pppoe / pppoe.c
index 2bdbd3a..97adc2b 100644 (file)
@@ -353,7 +353,7 @@ int vnet_pppoe_add_del_session
       pool_get_aligned (pem->sessions, t, CLIB_CACHE_LINE_BYTES);
       clib_memset (t, 0, sizeof (*t));
 
-      clib_memcpy (t->local_mac, hi->hw_address, 6);
+      clib_memcpy (t->local_mac, hi->hw_address, vec_len (hi->hw_address));
 
       /* copy from arg structure */
 #define _(x) t->x = a->x;