Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 May 2008 12:21:23 -0400
From:      Sam Leffler <sam@freebsd.org>
To:        freebsd-net@freebsd.org
Subject:   Re: How to inject fullsize 802.1q-tagged frame through BPF?
Message-ID:  <482C6303.9000904@freebsd.org>
In-Reply-To: <20080515152607.GA36663@roof1.dnepro.net>
References:  <20080515152607.GA36663@roof1.dnepro.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Eugene Perevyazko wrote:
> Hello,
>  I have an ethernet interface with several vlans on it (FreeBSD 6.2-RELEASE #0).
>  My program opens BPF on the parent device, receives tagged frames and responds 
> by writing tagged frame to the BPF fd.
>  It all works good, until size of response frame w/o tag becomes larger than 
> 1496 bytes (1500 with tag inserted) - mtu of parent device.i
>  I'm a bit confused as mtu is 1500 on both vlanN and it's parent fxp0.
>  I've tried to "ifconfig fxp0 mtu 1504" to make room for vlan tag, but 
> the response is 
> 	ifconfig: ioctl (set mtu): Invalid argument
> 
>  Trying "ifconfig fxp0 -vlanmtu" also makes no difference.
> 
>  Is there a way to inject full-mtu vlan-tagged frame through BPF on parent 
> device?
>  I'd like not to open several tenths of BPFs for each vlanN if it's possible.
> 
>  I've tried on bge also with same results, so that is not connected with fxp
> driver.

bpf write code in the kernel calculates header size when packets are 
injected.  This is likely based on the frames being stock 802.3 so would 
require mods to the bpf code to handle the additional space for the tag.

	Sam



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?482C6303.9000904>