Date: Sat, 4 Jan 2003 13:04:23 -0500 From: David Magda <dmagda+fstable@magda.ca> To: Evren Yurtesen <eyurtese@turkuamk.fi> Cc: Sten Daniel S?rsdal <sten.daniel.sorsdal@wan.no>, "Wright, Michaelx L" <michaelx.l.wright@intel.com>, fkittred@gwi.net, Michael Sierchio <kudzu@tenebras.com>, freebsd-stable@FreeBSD.ORG, wpaul@ctr.columbia.edu Subject: Re: wi0 and mtu setting [bad idea] Message-ID: <20030104180422.GA607@number6.magda.ca> In-Reply-To: <Pine.A41.4.10.10301041823050.19242-100000@bessel.tekniikka.turkuamk.fi> References: <20030104154328.GA266@number6.magda.ca> <Pine.A41.4.10.10301041823050.19242-100000@bessel.tekniikka.turkuamk.fi>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jan 04, 2003 at 06:25:09PM +0200, Evren Yurtesen wrote: > I want to change MTU because I will use PPPoE on wireless interfaces > So I need to set the MTU to 1508 so that 1500 byte ethernet frames can be > encapsulated in the access point and sent to the client. 1500byte ethernet > plus 8byte pppoe overhead makes a total of 1508 bytes MTU which I need. Why not hack /sys/dev/wi/if_wi? Simply change "ifp->if_mtu = ETHERMTU;" to "ifp->if_mtu = 1508;" and see what happens. If things break you go back, and if they work all the better. > You showed what is the ifmtu default, but how does ifconfig decide what is > the maximum MTU for this interface that a user can set? or it doesnt care > about the interface and maximum that you can set is 1500? This is all in the source: Doing a 'grep mtu /usr/src/sbin/ifconfig/*', you find in ifconfig.c: setifmtu(val, dummy, s, afp) const char *val; int dummy __unused; int s; const struct afswtch *afp; { strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); ifr.ifr_mtu = atoi(val); if (ioctl(s, SIOCSIFMTU, (caddr_t)&ifr) < 0) warn("ioctl (set mtu)"); } So it tries an ioctl(2) and checks the return status. The device driver enforces length limits internally and return()s appropriately. -- David Magda <dmagda at ee.ryerson.ca> Because the innovator has for enemies all those who have done well under the old conditions, and lukewarm defenders in those who may do well under the new. -- Niccolo Machiavelli, _The Prince_, Chapter VI To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030104180422.GA607>