ip6-nd: copy mac address to wrong buffer current_data 85/36585/2
authorliangrq <liangrq@efly.cc>
Mon, 4 Jul 2022 08:23:21 +0000 (16:23 +0800)
committerBeno�t Ganne <bganne@cisco.com>
Thu, 28 Jul 2022 08:13:48 +0000 (08:13 +0000)
Type: fix

Receive router solicitation in pop vlan interface, it will cause copy mac address to wrong buffer current_data and can not reply the solicitation right

Signed-off-by: liangrq <liangrq@efly.cc>
Change-Id: Ic40a5a47a52c8187aaf6c6854df761529e6f24d9

src/vnet/ip6-nd/ip6_ra.c

index 2985ac4..788984e 100644 (file)
@@ -637,6 +637,8 @@ icmp6_router_solicitation (vlib_main_t * vm,
                          /* Reuse current MAC header, copy SMAC to DMAC and
                           * interface MAC to SMAC */
                          vlib_buffer_reset (p0);
+                         vlib_buffer_advance (
+                           p0, vnet_buffer (p0)->l2_hdr_offset);
                          eth0 = vlib_buffer_get_current (p0);
                          clib_memcpy (eth0->dst_address, eth0->src_address,
                                       6);