From owner-freebsd-net@FreeBSD.ORG Wed Nov 12 15:23:47 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 42D7516A4CE; Wed, 12 Nov 2003 15:23:47 -0800 (PST) Received: from freesbee.wheel.dk (freesbee.wheel.dk [193.162.159.97]) by mx1.FreeBSD.org (Postfix) with ESMTP id 21F4143F85; Wed, 12 Nov 2003 15:23:44 -0800 (PST) (envelope-from jesper@skriver.dk) Received: by freesbee.wheel.dk (Postfix, from userid 1001) id BD2793850A; Thu, 13 Nov 2003 00:23:41 +0100 (CET) Date: Thu, 13 Nov 2003 00:23:41 +0100 From: Jesper Skriver To: Andre Oppermann Message-ID: <20031112232341.GJ41949@skriver.dk> Mail-Followup-To: Jesper Skriver , Andre Oppermann , freebsd-current@freebsd.org, freebsd-net@freebsd.org, sam@errno.com, mb@imp.ch, ume@freebsd.org References: <3FAE68FB.64D262FF@pipeline.ch> <20031112225326.GI41949@FreeBSD.org> <3FB2BE8A.6C880085@pipeline.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3FB2BE8A.6C880085@pipeline.ch> User-Agent: Mutt/1.4.1i X-PGP-Fingerprint: 6B88 9CE8 66E9 E631 C9C5 5EB4 22AB F0EC F956 1C31 X-PGP-Public-Key: http://freesbee.wheel.dk/~jesper/gpgkey.pub cc: freebsd-net@freebsd.org cc: freebsd-current@freebsd.org cc: mb@imp.ch cc: ume@freebsd.org cc: sam@errno.com Subject: Re: tcp hostcache and ip fastforward for review X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2003 23:23:47 -0000 On Thu, Nov 13, 2003 at 12:13:14AM +0100, Andre Oppermann wrote: > Jesper Skriver wrote: > > > > On Sun, Nov 09, 2003 at 05:19:07PM +0100, Andre Oppermann wrote: > > > Hello all, > > > > > > this patch contains three things (to be separated for committing): > ... > > > ip_fastforward > > > > > > - removes ip_flow forwarding code > > > - adds full direct process-to-completion IPv4 forwarding code > > > - handles ip fragmentation incl. hw support (ip_flow did not) > > > - supports ipfw and ipfilter (ip_flow did not) > > > - supports divert and ipfw fwd (ip_flow did not) > > > - drops anything it can't handle back to normal ip_input > > > > I have a few comments to this code, see inline, look for #jesper > > Answers also inline. [All whitespace bugs are fixed and omitted here] One comment at the bottom. > > Apart from that it looks good. > > Thanks for reviewing! > > > /Jesper > > > > > +int > > > +ip_fastforward(struct mbuf *m) > > > +{ > ... > > > + > > > + /* > > > + * Only unicast IP, not from loopback, no L2 or IP broadcast, > > > + * no multicast, no INADDR_ANY > > > + */ > > > + if ((m->m_pkthdr.rcvif->if_flags & IFF_LOOPBACK) || > > > + (ntohl(ip->ip_src.s_addr) == (u_long)INADDR_BROADCAST) || > > > > #jesper > > You will never see packets with a multicast source address. > > I hope so but we can never be sure. Here we look at what we've got > straight from the wire. Everything is possible there. I only need > to craft an apropriate packet... True, but do we really care if forwarded such a packet ? And if we want to check, we should just drop it directly instead of giving the packet to ip_input. /Jesper