Bug 204399 - error in handling vlan tag by raw ethernet socket
Summary: error in handling vlan tag by raw ethernet socket
Status: NEW
Alias: None
Product: Networking
Classification: Unclassified
Component: IPV4 (show other bugs)
Hardware: All Linux
: P1 high
Assignee: Stephen Hemminger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-01 06:37 UTC by Lvenkatakumarchakka
Modified: 2019-08-26 08:01 UTC (History)
1 user (show)

See Also:
Kernel Version: 5.0.0-21-generic #22-Ubuntu x86_64
Subsystem:
Regression: No
Bisected commit-id:


Attachments
set/unset the variable "stripping_vlan_tag" to reproduce the issue (5.04 KB, text/x-csrc)
2019-08-01 06:37 UTC, Lvenkatakumarchakka
Details

Description Lvenkatakumarchakka 2019-08-01 06:37:39 UTC
Created attachment 284067 [details]
set/unset the variable "stripping_vlan_tag" to reproduce the issue

I am using raw ethernet socket and sending/receiving network traffic.

problem I am seeing is if read socket is opened before starting sending the vlan traffic, read socket is able to capture packets along with vlan tag. but if I open the read socket before starting sending the packets, vlan tag is being stripped and only those four bytes are missing from the packet. Rest of the packet is intact.

Please refer to the small code snippet which consistently produces the bug.

set/unset the variable "stripping_vlan_tag" to reproduce the issue.

is this a bug in the kernel or any problem with my coding ?

I am working on a project where I will be opening all the required sockets at once and will be using as and when required. In that case, I am not able to capture vlan tags which is blocking me. However, tcpdump is capture along with vlan tag.

please be noted that, both the cards are in same system and are connected just back to back using a cat5 cable. eth0 is built-in card and eth1 is usb based external network card.

Is there a way to get rid of this issue ?

Best Regards,
Lokesh.
Comment 1 Lvenkatakumarchakka 2019-08-26 08:01:54 UTC
there is a typo in the description.

Start sending vlan tagged packets, then open the read socket - Able to capture vlan tag.
open read socket, then start sending packets with vlan tag - Unable to capture vlan tag.

Note You need to log in before you can comment on or make changes to this bug.