Netdev List
 help / color / mirror / Atom feed
* [RFC] VLAN aux info for AF_PACKET available only with ETH_P_ALL
@ 2016-04-14 15:17 Peter Palúch
  0 siblings, 0 replies; only message in thread
From: Peter Palúch @ 2016-04-14 15:17 UTC (permalink / raw)
  To: netdev

Greetings,

When using AF_PACKET sockets with PACKET_AUXDATA socket option to access 
the VLAN TCI information of received frames, I have noticed that the 
VLAN information in struct tpacket_auxdata, namely,

- tp_vlan_tci
- tp_vlan_tpid
- TP_STATUS_VLAN_VALID and TP_STATUS_VLAN_TPID_VALID flags

is filled in only when the socket is bound to htons (ETH_P_ALL). If the 
socket is bound to any specific protocol, the VLAN information fields in 
struct tpacket_auxdata are set to 0 even if the datagram of the specific 
protocol was received in an 802.1Q-tagged frame.

As the VLAN tag is being stripped off the frame soon in the receive 
path, using PACKET_AUXDATA is the only way for an application over an 
AF_PACKET socket to know what VLAN did a particular frame arrive in; 
yet, the current behavior forces the application to listen to all 
received traffic to get the actual VLAN info.

Is this behavior intentional, or is this lack of VLAN info a bug? I am 
running vanilla Linux kernel v4.4.6.

Thanks!

Best regards,
Peter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-04-14 15:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-14 15:17 [RFC] VLAN aux info for AF_PACKET available only with ETH_P_ALL Peter Palúch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox