vlan0 on em0 has mtu 1496

Doug Ambrisko ambrisko at ambrisko.com
Thu Apr 17 19:26:12 PDT 2003


Brooks Davis writes:
-- Start of PGP signed section.
| On Thu, Apr 17, 2003 at 08:34:47PM -0400, Mike Tancsa wrote:
| > At 05:19 PM 17/04/2003 -0700, Brooks Davis wrote:
| > >On Thu, Apr 17, 2003 at 08:13:55PM -0400, David Gilbert wrote:
| > >> Why does a vlan created against em0 have a mtu of 1496.
| > >
| > >Because the vlan header takes up 4 bytes.  With em(4) devices it looks
| > >like fixing that should be a simple matter of raising the real
| > >interface's MTU to 1504.
| > 
| > Why the difference in behavior vs how the fxp driver works with respect to 
| > vlans ?
| 
| I don't know.  In current both have the VLAN_MTU capability set, but I
| don't seem to be getting consistant results from 4.x systems.

I think it needs this:
  #if __FreeBSD_version >= 500000
          ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU; 
  #endif
changed to:
  /*
  * Tell the upper layer(s) we support long frames.
  */
  ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
  #if __FreeBSD_version >= 500000
          ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU; 
  #endif

to work for both -stable and -current.  Tomorrow I can test it out at work,
if someone beats me to it and commit it that's fine.

Doug A.


More information about the freebsd-net mailing list