From owner-freebsd-stable Sat Jan 4 10: 4:28 2003 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7933437B401 for ; Sat, 4 Jan 2003 10:04:26 -0800 (PST) Received: from tomts21-srv.bellnexxia.net (tomts21.bellnexxia.net [209.226.175.183]) by mx1.FreeBSD.org (Postfix) with ESMTP id 54F0D43EC2 for ; Sat, 4 Jan 2003 10:04:25 -0800 (PST) (envelope-from dmagda@magda.ca) Received: from number6.magda.ca ([64.229.224.16]) by tomts21-srv.bellnexxia.net (InterMail vM.5.01.04.19 201-253-122-122-119-20020516) with ESMTP id <20030104180424.YPCE7873.tomts21-srv.bellnexxia.net@number6.magda.ca>; Sat, 4 Jan 2003 13:04:24 -0500 Received: from number6.magda.ca (localhost.magda.ca [127.0.0.1]) by number6.magda.ca (8.12.6/8.12.6) with ESMTP id h04I4NkL000644 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Sat, 4 Jan 2003 13:04:24 -0500 (EST) (envelope-from dmagda@magda.ca) Received: (from dmagda@localhost) by number6.magda.ca (8.12.6/8.12.6/Submit) id h04I4NPQ000643; Sat, 4 Jan 2003 13:04:23 -0500 (EST) (envelope-from dmagda) Date: Sat, 4 Jan 2003 13:04:23 -0500 From: David Magda To: Evren Yurtesen Cc: Sten Daniel S?rsdal , "Wright, Michaelx L" , fkittred@gwi.net, Michael Sierchio , freebsd-stable@FreeBSD.ORG, wpaul@ctr.columbia.edu Subject: Re: wi0 and mtu setting [bad idea] Message-ID: <20030104180422.GA607@number6.magda.ca> Reply-To: David Magda References: <20030104154328.GA266@number6.magda.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 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