Date: Wed, 19 Jan 2000 16:48:20 +0200 From: Ruslan Ermilov <ru@FreeBSD.ORG> To: Jim Flowers <jflowers@ezo.net>, Mikhail Teterin <mi@kot.ne.mediaone.net>, net@FreeBSD.ORG Subject: Re: Natd with Pmtu Discovery Message-ID: <20000119164820.A41863@relay.ucb.crimea.ua> In-Reply-To: <20000119145729.A11150@relay.ucb.crimea.ua>; from Ruslan Ermilov on Wed, Jan 19, 2000 at 02:57:30PM %2B0200 References: <20000106143722.A2080@relay.ucb.crimea.ua> <Pine.BSI.3.91.1000106091555.29680A-100000@lily.ezo.net> <20000119145729.A11150@relay.ucb.crimea.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
--s/l3CgOIzMHHjg/5 Content-Type: text/plain; charset=us-ascii On Wed, Jan 19, 2000 at 02:57:30PM +0200, Ruslan Ermilov wrote: > [Redirected to -net, Bcc'ed to -hackers] > > On Thu, Jan 06, 2000 at 09:31:27AM -0500, Jim Flowers wrote: > > OK. I followed this a little further. The problem is that the natd read > > of the interface mtu precedes the skip routine that modifies it. > > Unfortunately, when the skip routine modifies the interface mtu it does > > not send a message to the socket as it does when the address is changed > > so the -dynamic flag doesn't help. > > > > Currently, I moved the the initiation of natd to rc.local to follow the > > skip change to the interface mtu but this is less than ideal. > > > > A better approach would be to notify the natd module of any > > interface mtu change via the socket, similar to when the address is > > changed with the -dynamic flag set. This would also pick of manual > > changes. > > > Hmm, I thought of this too, but this will not fix the problem with natd. > Please try the following patch with -dynamic flag of natd(8)! This patch is for -stable, but could be trivially adopted for -current. > Consider the case when natd(8) is not bound to any specific interface, > and it sends packets via multiple interfaces (in my case, for example). > This case is not fixed by this patch. -- Ruslan Ermilov Sysadmin and DBA of the ru@ucb.crimea.ua United Commercial Bank, ru@FreeBSD.org FreeBSD committer, +380.652.247.647 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age --s/l3CgOIzMHHjg/5 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p Index: src/sbin/natd/natd.c =================================================================== RCS file: /usr/FreeBSD-CVS/src/sbin/natd/natd.c,v retrieving revision 1.11.2.7 diff -u -p -1 -3 -r1.11.2.7 natd.c --- natd.c 1999/10/28 18:55:35 1.11.2.7 +++ natd.c 2000/01/19 14:14:07 @@ -632,27 +632,27 @@ static void HandleRoutingInfo (int fd) Warn ("read from routing socket failed"); return; } if (ifMsg.ifm_version != RTM_VERSION) { Warn ("unexpected packet read from routing socket"); return; } if (verbose) printf ("Routing message %X received.\n", ifMsg.ifm_type); - if (ifMsg.ifm_type != RTM_NEWADDR) + if (ifMsg.ifm_type != RTM_NEWADDR && ifMsg.ifm_type != RTM_IFINFO) return; if (verbose && ifMsg.ifm_index == ifIndex) printf ("Interface address has changed.\n"); if (ifMsg.ifm_index == ifIndex) assignAliasAddr = 1; } static void PrintPacket (struct ip* ip) { printf ("%s", FormatPacket (ip)); } Index: src/sys/net/if.c =================================================================== RCS file: /usr/FreeBSD-CVS/src/sys/net/if.c,v retrieving revision 1.64.2.1 diff -u -p -1 -3 -r1.64.2.1 if.c --- /usr/src/sys/net/if.c 1999/08/29 16:28:14 1.64.2.1 +++ /usr/src/sys/net/if.c 2000/01/19 14:20:34 @@ -640,28 +640,30 @@ ifioctl(so, cmd, data, p) case SIOCSIFMTU: error = suser(p->p_ucred, &p->p_acflag); if (error) return (error); if (ifp->if_ioctl == NULL) return (EOPNOTSUPP); /* * 72 was chosen below because it is the size of a TCP/IP * header (40) + the minimum mss (32). */ if (ifr->ifr_mtu < 72 || ifr->ifr_mtu > 65535) return (EINVAL); error = (*ifp->if_ioctl)(ifp, cmd, data); - if (error == 0) + if (error == 0) { getmicrotime(&ifp->if_lastchange); + rt_ifmsg(ifp); + } return(error); case SIOCADDMULTI: case SIOCDELMULTI: error = suser(p->p_ucred, &p->p_acflag); if (error) return (error); /* Don't allow group membership on non-multicast interfaces. */ if ((ifp->if_flags & IFF_MULTICAST) == 0) return EOPNOTSUPP; /* Don't let users screw up protocols' entries. */ --s/l3CgOIzMHHjg/5-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000119164820.A41863>