ip: punt socket - take the tags in Ethernet header into consideration 35/34635/8
authorAndrew Yourtchenko <ayourtch@gmail.com>
Fri, 17 Mar 2023 01:47:58 +0000 (01:47 +0000)
committerAndrew Yourtchenko <ayourtch@gmail.com>
Wed, 12 Apr 2023 15:26:23 +0000 (15:26 +0000)
commitfeb77422a3435f4fd25c3a6e12df1bb9526b342a
treee1ecb2ba6c1c8e30225db6d916e7a67b563b3ed0
parent393a05f2897db8459a660eb631a25ced2212115d
ip: punt socket - take the tags in Ethernet header into consideration

The punt socket code rewinds the current_data pointer by sizeof (ethernet_header_t),
which is incorrect if the header is tagged - resulting in truncated destination MAC
address. Use ethernet_buffer_header_size() instead, which takes tags into account.

Also add the unittest that verifies the issue and the fix.

Type: fix
Change-Id: I6352a174df144ca1e4230390c126f4b698724ebc
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
src/vnet/ip/punt_node.c
test/test_punt.py