summaryrefslogtreecommitdiffstats
path: root/sys/net/if_tap.c
diff options
context:
space:
mode:
authorscf <scf@FreeBSD.org>2009-03-16 03:11:02 +0000
committerscf <scf@FreeBSD.org>2009-03-16 03:11:02 +0000
commitc01f39de6f59b2bfdbdd7da5d649253cfaa63bca (patch)
treefc832d019b52c453c6e0d6bbde0546dd30d55a38 /sys/net/if_tap.c
parenteb1d81774b04c4630352be03c2287a52fdd0453b (diff)
downloadFreeBSD-src-c01f39de6f59b2bfdbdd7da5d649253cfaa63bca.zip
FreeBSD-src-c01f39de6f59b2bfdbdd7da5d649253cfaa63bca.tar.gz
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
Diffstat (limited to 'sys/net/if_tap.c')
-rw-r--r--sys/net/if_tap.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/net/if_tap.c b/sys/net/if_tap.c
index b4ee7e1..99c5968 100644
--- a/sys/net/if_tap.c
+++ b/sys/net/if_tap.c
@@ -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, caddr_t data)
case SIOCDELMULTI:
break;
+ case SIOCSIFMTU:
+ s = splimp();
+ ifp->if_mtu = ifr->ifr_mtu;
+ splx(s);
+ break;
+
case SIOCGIFSTATUS:
s = splimp();
ifs = (struct ifstat *)data;
OpenPOWER on IntegriCloud