Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Mar 2009 03:11:02 +0000 (UTC)
From:      Sean Farley <scf@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r189866 - head/sys/net
Message-ID:  <200903160311.n2G3B2wn047002@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: scf
Date: Mon Mar 16 03:11:02 2009
New Revision: 189866
URL: http://svn.freebsd.org/changeset/base/189866

Log:
  Add the SIOCSIFMTU ioctl handling directly to tap(4) permitting it to
  have its MTU set higher than 1500 (ETHERMTU).  Its new limit is now
  65535 as enforced by ifhwioctl() in if.c
  
  This allows a tap(4) device to be added to a bridge, which requires all
  interface members to have the same MTU, with an interface configured for
  jumbo frames.  QEMU may now connect to a network via tap(4) without
  requiring the real interface to have its MTU set to 1500 or lower.
  
  Reviewed by:	rpaulo, bms
  MFC after:	1 week

Modified:
  head/sys/net/if_tap.c

Modified: head/sys/net/if_tap.c
==============================================================================
--- head/sys/net/if_tap.c	Sun Mar 15 23:52:13 2009	(r189865)
+++ head/sys/net/if_tap.c	Mon Mar 16 03:11:02 2009	(r189866)
@@ -600,6 +600,7 @@ static int
 tapifioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
 {
 	struct tap_softc	*tp = ifp->if_softc;
+	struct ifreq		*ifr = (struct ifreq *)data;
 	struct ifstat		*ifs = NULL;
 	int			 s, dummy;
 
@@ -609,6 +610,12 @@ tapifioctl(struct ifnet *ifp, u_long cmd
 		case SIOCDELMULTI:
 			break;
 
+		case SIOCSIFMTU:
+			s = splimp();
+			ifp->if_mtu = ifr->ifr_mtu;
+			splx(s);
+			break;
+
 		case SIOCGIFSTATUS:
 			s = splimp();
 			ifs = (struct ifstat *)data;



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