From owner-freebsd-net Wed Jun 21 8:37:25 2000 Delivered-To: freebsd-net@freebsd.org Received: from nothing-going-on.demon.co.uk (dhcp120.conference.usenix.org [209.179.127.120]) by hub.freebsd.org (Postfix) with ESMTP id 0AA8137BED6 for ; Wed, 21 Jun 2000 08:37:19 -0700 (PDT) (envelope-from nik@nothing-going-on.demon.co.uk) Received: (from nik@localhost) by nothing-going-on.demon.co.uk (8.9.3/8.9.3) id UAA00906 for net@freebsd.org; Tue, 20 Jun 2000 20:17:34 GMT (envelope-from nik) Date: Tue, 20 Jun 2000 20:17:34 +0000 From: Nik Clayton To: net@freebsd.org Subject: No route for 127/8 to lo0 Message-ID: <20000620201733.A665@kilt.nothing-going-on.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i Organization: FreeBSD Project Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Chaps, [ Not on -net, please cc: replies back to me ] This is a continuation of a discussion I started on -hackers some time ago (with the same subject line), but -net is probably the more appropriate forum. Why don't we automatically include a network route for 127/8 to lo0? I first noticed this when I saw Samba repeatedly triggering a PPP dialup. It turns out Samba is sending occasional broadcasts to 127.255.255.255. There's no route for that address on a 3.4/4.x system, so the packets end up going out of the default route. This is bad for PPP systems (or other systems that pay for outgoing traffic in some way). RFC1122 says [...] (g) { 127, } Internal host loopback address. Addresses of this form MUST NOT appear outside a host. [...] For most purposes, a datagram addressed to a broadcast or multicast destination is processed as if it had been addressed to one of the host's IP addresses; Is there some special-case for 127/8 that's covered by the "For most purposes" line? If you look in src/sys/netinet/in.c:in_ifinit() (around line 700) you'll see that IFF_LOOPBACK is special cased in the code to only add a host route, rather than a network route, and it's been like that for about 15 years or so. At the moment I just have a /usr/local/etc/rc.d/local-route.sh script which runs route add -net 127 -interface lo0 at startup. But it's a bit of a kludge. . . N -- Internet connection, $19.95 a month. Computer, $799.95. Modem, $149.95. Telephone line, $24.95 a month. Software, free. USENET transmission, hundreds if not thousands of dollars. Thinking before posting, priceless. Somethings in life you can't buy. For everything else, there's MasterCard. -- Graham Reed, in the Scary Devil Monastery To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message