David Acker wrote:
This is patch for include/linux/if_vlan.h .  Its purpose is to allow a
user space program to use the vlan_ethhdr structure when directly
handling 802.1Q packets.  This can be done by using a raw socket like:
int s = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
This socket should see VLAN packets from the base interface unchanged
(i.e. vlan tag still in packet).
Currently other user space programs that understand VLANs seem to all
create their own definitions for fields and sizes of things.
This patch exposes the defines related to the sizes of VLAN packets and
their fields along with the vlan_ethhdr structure.  The sizes are useful
since they let the user space program know how much space is really
needed to receive VLAN packets.
-Dave Acker

The reason I suggested to not make the size #defines visible is that it really 
doesn't help
much.  If you are receiving in user space, a more useful number is:

sizeof(vlan_eth_header) + MTU of interface

Depending on the underlying NIC, you may still receive larger packets, so
never assume you absolutely know the max size of pkt to be read:  Check the
return values from recvfrom, etc.

Thanks,
Ben

--
Ben Greear <[EMAIL PROTECTED]>
Candela Technologies Inc  http://www.candelatech.com

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to